threeDigits property

String get threeDigits

3位补0

Implementation

String get threeDigits {
  int absN = this.abs();
  String sign = this < 0 ? "-" : "";
  if (absN >= 100) return "$this";
  if (absN >= 10) return "${sign}0$this";
  return "${sign}00$this";
}