currency method

String currency({
  1. String? locale,
  2. String? name,
  3. String? symbol,
  4. int? decimalDigits,
  5. String? customPattern,
})

format number with intl currency format

Implementation

String currency({
  String? locale,
  String? name,
  String? symbol,
  int? decimalDigits,
  String? customPattern,
}) {
  if (this == null) return '';
  return NumberFormat.currency(
    locale: locale,
    name: name,
    symbol: symbol,
    decimalDigits: decimalDigits,
    customPattern: customPattern,
  ).format(this!);
}