Module: AgentXmpp::StandardLibrary::FloatPatches::InstanceMethods

Defined in:
lib/agent_xmpp/patches/float.rb

Overview


Instance Method Summary collapse

Instance Method Details

#precision(p = 3) ⇒ Object

.….….….….….….….….….….….….….….….….….….….….….….….….…..



10
11
12
# File 'lib/agent_xmpp/patches/float.rb', line 10

def precision(p = 3)
  (10.0**p*self).round.to_f/10.0**p
end