Post

Ruby float methods

Ruby float methods

Rounding with .round:

1
2
3
my_float = 3.1415926 
my_float.round(2)
=> # 3.14
This post is licensed under CC BY 4.0 by the author.