Decimal.abs
abs
Group: Math
Documentation
Computes the absolute value of this. The absolute value of a positive number is itself, while the absolute value of a negative number is that number multiplied by -1.
Examples
Compute the absolute value of a Decimal
.
Decimal.new "-12.345" . abs
# => 12.345