> If days is a large number, say a year, it usually ends up with a number
> like 7.4799999999999999984. Is there a way to fix this? Perhaps chopping
> off after 2 decimal places in a string? Thanks in advance!
>

This is not as detailed but it may be worth a look.

n = 7.4799999999999999984
p n.round(2) #> 7.48
p n.round(1) #> 7.5


http://www.ruby-doc.org/core/classes/Float.html#M000144



Harry