format static method

String format(
  1. double n
)

Implementation

static String format(double n) {
  if (n >= 10000) {
    n /= 1000;
    return "${twoDecimal(n.toString())}K";
  } else {
    return "${fourDecimal(n.toString())}";
  }
}