Class: Float
- Defined in:
- lib/plist4r/mixin/ruby_stdlib.rb
Instance Methods
Instance Method Details
- (Object) round(n = 0) Also known as: round_orig
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 |