Here you can find the source of pad(double n)
public static String pad(double n)
//package com.java2s; //License from project: Apache License import java.text.DecimalFormat; public class Main { private static final DecimalFormat formatter = new DecimalFormat("0000000000.00"); public static String pad(double n) { return formatter.format(n); }/* w ww . j a v a2 s .c o m*/ }