Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUBY

rails convert euro to dollar

# https://github.com/RubyMoney/money
Money.add_rate("USD", "EUR", 0.88)

Money.us_dollar(88).exchange_to("EUR")  # => Money.new(100, "EUR")

Money.from_cents(1000, 'EUR').exchange_to("USD")  # => Money.new(880, "USD")
 
PREVIOUS NEXT
Tagged: #rails #convert #euro #dollar
ADD COMMENT
Topic
Name
2+4 =