Sha256: d111c4f5a8e8e614fba62b21371baa90a39b441b6b6770a1783a99731282a3c7
Contents?: true
Size: 282 Bytes
Versions: 56
Compression:
Stored size: 282 Bytes
Contents
# Taken from http://www.programmingishard.com/posts/show/128 # Posted by rbates class Float def round_to(x) (self * 10**x).round.to_f / 10**x end def ceil_to(x) (self * 10**x).ceil.to_f / 10**x end def floor_to(x) (self * 10**x).floor.to_f / 10**x end end
Version data entries
56 entries across 56 versions & 4 rubygems