currency static method

String currency(
  1. num amount, {
  2. String symbol = '\$',
  3. int decimals = 2,
  4. bool symbolBefore = true,
  5. String? locale,
})

Implementation

static String currency(
  num amount, {
  String symbol = '\$',
  int decimals = 2,
  bool symbolBefore = true,
  String? locale,
}) {
  final formatted = format(amount, decimals: decimals, locale: locale);
  return symbolBefore ? '$symbol$formatted' : '$formatted$symbol';
}