Here you can find the source of getFormattedNumber(String input)
public static String getFormattedNumber(String input)
//package com.java2s; import java.text.DecimalFormat; public class Main { private static DecimalFormat df = null; public static String getFormattedNumber(String input) { if (df == null) { return input; }// w ww .j a v a2 s. c o m try { return df.format(Double.parseDouble(input)); } catch (NumberFormatException nfe) { return input; } } }