Module: DigitalOpera::Banker

Extended by:
ActiveSupport::Concern
Defined in:
lib/digital_opera/banker.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#banker_convert_currency(value, conversion) ⇒ Object

Instance Methods ——————————————————–



36
37
38
39
40
41
42
43
# File 'lib/digital_opera/banker.rb', line 36

def banker_convert_currency(value, conversion)
  case conversion.to_sym
  when :to_cents
    return (value.to_s.gsub(/,/, '').to_f * 100).to_i
  when :to_dollars
    return "%0.2f" % (value.to_f / 100)
  end
end