formatCurrency method
Formats the number as currency.
Example:
1234.formatCurrency(); // '\$1,234.00'
1234.formatCurrency(symbol: '€'); // '€1,234.00'
Implementation
String formatCurrency({String symbol = '\$', int decimals = 2}) =>
'$symbol${formatWithSeparator()}.${0.toStringAsFixed(decimals).split('.')[1]}';