compact static method

String compact(
  1. num value, {
  2. String? locale,
})

Formats value as a compact number (e.g. 1.2K, 3.4M).

Implementation

static String compact(num value, {String? locale}) {
  final NumberFormat format = NumberFormat.compact(locale: locale);
  return format.format(value);
}