Skip to main content
1

πŸ’° Currency Formatting

toCurrency()
String
Converts the number to a given currency format, correctly handling thousand separators, decimal places, and symbol placement.
final euroAmount = 9876.5;
print(euroAmount.toCurrency(
  currencySymbol: '€',
  thousandsSeparator: '.',
  decimalSeparator: ',',
  currencyDirection: CurrencyDirection.right,
));
// 9.876,50 €
2

πŸ“Š Abbreviation

toAbbreviated()
String
Abbreviates the number to a concise format (e.g., 1.1B, 2.0K). Used for displaying large counts cleanly in UIs.
print(1000000000.toAbbreviated(currencySymbol: 'USD')); // USD 1.0B