Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
# This is a service deployed into CoreRest app
# A service to calculate a simple interest rate.
# The service receives principal, rate and time to calculate.
# Things to remember:
# 1) If you want to send a decimal value, you should use a "." to
# separate decimal, like "9.5".
# 2) Simple Interest calculation is based on Principal * Rate * Time.
# So, if you want $4500 at 9.5% for 6 years, the URL to use would be:
($principal.to_f * ($rate.to_f/100) * $time.to_f).to_s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment