Class: Float
Instance Method Summary collapse
-
#round(n = 0) ⇒ Object
Round to nearest n decimal places.
- #round_orig ⇒ Object
Instance Method Details
#round(n = 0) ⇒ Object
Round to nearest n decimal places
220 221 222 |
# File 'lib/plist4r/mixin/ruby_stdlib.rb', line 220 def round(n=0) sprintf("%#{n}.#{n}f", self).to_f end |
#round_orig ⇒ Object
216 |
# File 'lib/plist4r/mixin/ruby_stdlib.rb', line 216 alias_method :round_orig, :round |