This blog is part of our Ruby 2.4 series.
In Ruby, there are many methods available which help us to modify a float or integer value.
In the previous versions of Ruby,
we could use methods such as
truncate in following ways.
Providing an argument to these
methods would result
Ruby community decided to come up with an option to add precision argument .
The precision argument, which can be negative, helps us to get result to the required precision to either side of the decimal point.
The default value for the precision argument is 0.
These methods all work the same on Integer as well.