numFormat static method

String numFormat(
  1. int num
)

数量格式化

Implementation

static String numFormat(int num) {
  if (num > 999 && num <= 9999) {
    return "${roundingNum((num / 1000), 1)} k";
  } else if (num > 9999 && num <= 99999999) {
    return "${roundingNum((num / 10000), 1)} w";
  } else if (num > 99999999) {
    return "${roundingNum((num / 100000000), 1)} b";
  } else {
    return num.toString();
  }
}