toFixed method
String
toFixed({
- int? decimalPlaces,
- NumberFormat? format,
- RoundingMode rounding = RoundingMode.roundDown,
Implementation
String toFixed({
int? decimalPlaces,
NumberFormat? format,
RoundingMode rounding = RoundingMode.roundDown,
}) {
final decimal = decimalPlaces ?? currency.decimals;
assert(decimal <= currency.decimals, 'DECIMALS');
final fraction = super.tryParseFraction(decimalScale);
return super
.divide(fraction)
.toFixedNative(decimal, format: format, rounding: rounding);
}