shortIndianNumeral method

String shortIndianNumeral(
  1. dynamic value
)

Implementation

String shortIndianNumeral(dynamic value) {
  late dynamic val;

  if (value.runtimeType is String) {
    val = double.parse(value);
  } else {
    val = value;
  }

  if (val >= 0 && val < 999) return "$val";

  if (val > 999 && val <= 99999) {
    return "${val / 1000} thousand";
  } else if (val > 99999 && val <= 9999999) {
    return "${val / 100000} lakh";
  }
  if (value > 9999999 && value <= 999999999) {
    return "${val / 10000000} crore";
  }
  if (value > 999999999 && value <= 9999999999) {
    {
      return "${val / 1000000000} Arab";
    }
  } else {
    return "${val / 100000000000} Kharab";
  }
}