Decimal.truncate
truncate
Group: Rounding
Aliases: int
Documentation
Truncate a number to an Integer
to by dropping the fractional part. This is equivalent to "round-toward-zero".
Examples
Compute the truncation of 12.34
Decimal.new "12.34" . truncate
# => Decimal.new "12"
Compute the truncation of -12.34
Decimal.new "-12.34" . truncate
# => Decimal.new "-12"