Here you can find the source of toNumberFormat(String input)
public static String toNumberFormat(String input)
//package com.java2s; import java.text.*; public class Main { public static String toNumberFormat(String input) { if (input.indexOf(".") != -1) return NumberFormat.getInstance().format((new java.lang.Double(input)).doubleValue()); else {//w w w . j a v a2 s . co m return NumberFormat.getInstance().format((new java.lang.Long(input)).longValue()); } } }