numberToString static method

String numberToString(
  1. int number,
  2. int minSize
)

Present number as string with insignificant zeros

Implementation

static String numberToString(int number, int minSize) {
  String result = number.toString();
  int toMinSize = minSize - result.length;
  return ("0" * toMinSize) + result;
}