Here you can find the source of formatZeroDecimals(Number x)
public static String formatZeroDecimals(Number x)
//package com.java2s; //License from project: Open Source License import java.util.Formatter; public class Main { public static String formatZeroDecimals(Number x) { return new Formatter().format("%,.0f", x == null ? Double.NaN : x.doubleValue()).toString(); }//from w ww . ja v a2 s .c o m }