doubleToString static method

String doubleToString(
  1. double value, {
  2. String? locale,
  3. int digit = 0,
})

Implementation

static String doubleToString(double value, {String? locale, int digit = 0}) {
  String tmp = value.toString();
  try {
    final nfc = NumberFormat.currency(locale: locale??Constants().localeVILang, decimalDigits: digit);
    tmp = nfc.format(value).replaceAll(RegExp(nfc.currencyName!), '').trim();
  } catch (_) {}
  return tmp;
}