Here you can find the source of format(Double number)
public static String format(Double number)
//package com.java2s; public class Main { public static String format(String num) { int index = num.indexOf("."); num = num.substring(0, index);// w ww .j a v a 2 s. c om return num; } public static String format(Double number) { String num = String.valueOf(number); int index = num.indexOf("."); num = num.substring(0, index); return num; } }