Class: Braspag::Utils

Inherits:
Object
  • Object
show all
Defined in:
lib/rbraspag/utils.rb

Class Method Summary collapse

Class Method Details

.convert_decimal_to_string(value) ⇒ Object



4
5
6
7
8
# File 'lib/rbraspag/utils.rb', line 4

def self.convert_decimal_to_string(value)
  cents = "0#{((value - value.to_i) * 100).to_i}".slice(-2,2)
  integer = (value - (value - value.to_i)).to_i
  "#{integer},#{cents}"
end