Class: Float
Overview
File lib/core/facets/float/round.rb, line 17 def round_at( d ) #d=0
(self * (10.0 ** d)).round.to_f / (10.0 ** d)
end
Instance Method Summary collapse
Instance Method Details
#truncate_with_precision(d) ⇒ Object
35 36 37 |
# File 'lib/quality_extensions/float/truncate.rb', line 35 def truncate_with_precision(d) (self * (10.0 ** d)).truncate_without_precision.to_f / (10.0 ** d) end |