Decimal.-
-that
Group: Operators
Aliases: minus
Documentation
Subtract a Decimal
or other kind of number from another Decimal
, or subtract a Decimal
from another kind of number.
Arguments to -
will undergo automatic conversions such that you need not convert other numeric types to Decimal
manually.
Arguments
that
: The number to subtract from this.
Examples
Subtracting 10.22 from 20.33.
a = Decimal.new "20.33"
b = Decimal.new "10.22"
c = a - b
# => Decimal.new 10.11