Here you can find the source of renderNumber(int n, int size)
public static String renderNumber(int n, int size)
//package com.java2s; //License from project: LGPL import java.text.NumberFormat; public class Main { public static String renderNumber(int n, int size) { NumberFormat nf = NumberFormat.getInstance(); nf.setMinimumIntegerDigits(size); nf.setGroupingUsed(false);/*from w w w . ja v a 2 s . co m*/ return nf.format(n); } }