Skip to content

Instantly share code, notes, and snippets.

@9cardinals
9cardinals / compound interest
Last active February 3, 2020 21:13
simple compound interest calculator using math operations in ruby
# principal amount
p = 10_000
# annual rate of interest
r = 0.05
# number of years
t = 5
@9cardinals
9cardinals / gist:7313305
Created November 5, 2013 03:16
simple string interpolation example in ruby
p "hello #{3}"
num = 5
p "hello #{num}"