Here you can find the source of formatNumber(double num)
public static String formatNumber(double num)
//package com.java2s; // This code is released under the RoboWiki Public Code Licence (RWPCL), datailed on: public class Main { public static String formatNumber(double num) { return java.text.NumberFormat.getNumberInstance().format(num); }//from w ww .j a va 2 s .co m }