currencyFormat static method

String currencyFormat(
  1. double? value, {
  2. bool zeroIsEmpty = true,
})

Implementation

static String currencyFormat(double? value, {bool zeroIsEmpty = true}) {
  final oCcy = NumberFormat("#,###.##########", "en_US");
  var val = oCcy.format(value ?? 0);
  return val == "0" && zeroIsEmpty ? "" : val;
}