this is a simple calculation formula im doing trying ruby for the first time and stuck on a simple error bt need some guidance
#input
loan_amount = 0
rate = 0
period = 0
#output
monthly_payment = 0
print "Enter loan_amount: "
loan_amount = gets.to_f
print "Enter rate: "
rate = gets.to_f
print "Enter period: "
period = gets.to_f
monthly_payment = loan_amount((rate(1 + rate)**period)/(1 + rate)**period - 1)
puts "#{monthly_payment}"
There is a gem called Exonio: https://github.com/Noverde/exonio . This gem implements some of the Excel financials methods like: PMT, IPMT, PV, NPER...