📜  rails 将欧元转换为美元 - Ruby 代码示例

📅  最后修改于: 2022-03-11 15:04:48.302000             🧑  作者: Mango

代码示例1
# 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")