Here you can find the source of formatNumber(Number num)
public static String formatNumber(Number num)
//package com.java2s; //License from project: Creative Commons License import java.text.NumberFormat; import java.util.Locale; public class Main { private static final NumberFormat numberFormat = NumberFormat.getInstance(Locale.ENGLISH); public static String formatNumber(Number num) { return getNumberFormat().format(num); }/*from ww w . j a v a2 s . c o m*/ public static NumberFormat getNumberFormat() { return numberFormat; } }