Class: Float

Inherits:
Object
  • Object
show all
Defined in:
lib/rufirmata/extensions.rb

Instance Method Summary collapse

Instance Method Details

#prec(x) ⇒ Object



2
3
4
# File 'lib/rufirmata/extensions.rb', line 2

def prec(x)
  sprintf("%.0" + x.to_i.to_s + "f", self).to_f
end