Class Float
In: lib/core/facets/numeric/round_to.rb
Parent: Object

Methods

round_to  

Public Instance methods

Rounds to the nearest _n_th degree.

  4.555.round_to(1)     #=> 5.0
  4.555.round_to(0.1)   #=> 4.6
  4.555.round_to(0.01)  #=> 4.56
  4.555.round_to(0)     #=> 4.555

CREDIT: Trans

[Validate]