toCents method
Rounds the rational number to the nearest cent (two decimal places)
Parameters:
mode: The rounding mode to apply. Defaults to RoundingMode.halfUp
Returns: The rational number rounded to the nearest cent
Implementation
Rational toCents([RoundingMode mode = RoundingMode.halfUp]) {
return toNearestDecimal(2, mode: mode);
}