currencyFormat static method

String currencyFormat(
  1. double amount, {
  2. String? symbol,
  3. String locale = 'id_ID',
  4. int decimalDigits = 2,
  5. String? customPattern,
})

Implementation

static String currencyFormat(
  double amount, {
  String? symbol,
  String locale = 'id_ID',
  int decimalDigits = 2,
  String? customPattern,
}) {
  final NumberFormat format = NumberFormat.currency(
    locale: locale,
    symbol: symbol,
    decimalDigits: decimalDigits,
    customPattern: customPattern,
  );

  return format.format(amount);
}