Class: Float
- Inherits:
-
Object
- Object
- Float
- Defined in:
- lib/geohash.rb
Instance Method Summary collapse
Instance Method Details
#decimals(places) ⇒ Object
4 5 6 7 |
# File 'lib/geohash.rb', line 4 def decimals(places) n = (self * (10 ** places)).round n.to_f/(10**places) end |