User talk:Tbfrubyonrails

I'm new to ruby on rails and now im trying to do RD(Reccuring Deposit) calculation in Rails.can any one tell me how to do RD calculation? here is the formula for calculating interest for 1month recurring deposit:

amount * interest_rate * days / (no_of_days_in_year * 100.0)

where amount is deposited amount, interest_rate is rate of interest(9%,10%,10.5%), days is 30, no_of_days_in_year is taken as 365, 100 is for rate_of_interest. What should I do if I want to calculate interest for 12 months (1 year)? For example, amount=100 for the 1st installment, 200 for 2nd installment upto 1200 for 12th installment. For every installment amount should be added with interest. Finally how should i calculate maturity amount for 1 year recurring deposit.