Class: Float
Instance Method Summary collapse
-
#precision(p = 3) ⇒ Object
.….….….….….….….….….….….….….….….….….….….….….….….….…..
Instance Method Details
#precision(p = 3) ⇒ Object
.….….….….….….….….….….….….….….….….….….….….….….….….…..
5 6 7 |
# File 'lib/agent_xmpp/patches/float.rb', line 5 def precision(p = 3) (10.0**p*self).round.to_f/10.0**p end |