formatNullableAmount static method

String formatNullableAmount(
  1. num? amount, {
  2. String symbol = '₹',
  3. String locale = defaultLocale,
  4. int decimalDigits = 0,
})

Formats a nullable amount.

Returns fallback when the value is null.

Implementation

static String formatNullableAmount(
  num? amount, {
  String symbol = '₹',
  String locale = defaultLocale,
  int decimalDigits = 0,
}) {
  if (amount == null) {
    return fallback;
  }
  return formatAmount(
    amount,
    symbol: symbol,
    locale: locale,
    decimalDigits: decimalDigits,
  );
}