operator * method
Calculates product of this and the argument.
The return value will have fractionDigits that's
max(this.fractionDigits, other.fractionDigits)
.
Implementation
Decimal operator *(Decimal other) {
var fractionDigits = this.fractionDigits;
final otherFractionDigits = other.fractionDigits;
if (otherFractionDigits > fractionDigits) {
fractionDigits = otherFractionDigits;
}
return _NumDecimal(
toDouble() * other.toDouble(),
fractionDigits: fractionDigits,
);
}