rails convert euro to dollar

# 1. Install the 'money' gem for currency conversion.
# Add the following line to your Gemfile and run 'bundle install':
# gem 'money'

# 2. Require necessary libraries.
require 'money'
require 'money/bank/google_currency'

# 3. Set up the currency exchange rates provider.
Money.default_bank = Money::Bank::GoogleCurrency.new

# 4. Set the base currency and amount.
amount_in_euro = 100
base_currency = 'EUR'

# 5. Convert Euro to US Dollar.
amount_in_dollar = Money.new(amount_in_euro * 100, base_currency).exchange_to('USD')

# 6. Display the result.
puts "#{amount_in_euro} Euro is equal to #{amount_in_dollar.format} US Dollar"