toCurrencyFormat method

String toCurrencyFormat({
  1. bool isMorethan2 = false,
})

converts number to thousand format with 2 dp e.g convert 1000 to 1,000.00

Implementation

String toCurrencyFormat({bool isMorethan2 = false}) {
  final formatter =
      isMorethan2 ? NumberFormat("#,##0.000000") : NumberFormat("#,##0.00");
  return formatter.format(this);
}