Module: Adyen::Formatter::Price

Defined in:
lib/adyen/formatter.rb

Class Method Summary collapse

Class Method Details

.from_cents(price) ⇒ Object



32
33
34
# File 'lib/adyen/formatter.rb', line 32

def self.from_cents(price)
  BigDecimal.new(price.to_s) / 100
end

.in_cents(price) ⇒ Object



28
29
30
# File 'lib/adyen/formatter.rb', line 28

def self.in_cents(price)
  ((price * 100).round).to_i
end