Guest User

Untitled

a guest
Jun 21st, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. # Extends Float class to make it possible rounding wiht more decimals
  2. Float.class_eval do
  3. alias :original_round :round
  4. def round(decs = 0)
  5. (self * 10 ** decs).original_round.to_f / 10 ** decs
  6. end
  7. end
Add Comment
Please, Sign In to add comment