Here you can find the source of formatNumValueWithComma(double val)
public static double formatNumValueWithComma(double val)
//package com.java2s; //License from project: Apache License import java.text.DecimalFormat; public class Main { public static double formatNumValueWithComma(double val) { double formattedValue; DecimalFormat formatter = new DecimalFormat("#,###,##0.00"); String newValue = formatter.format(val); formattedValue = Double.parseDouble(newValue); return formattedValue; }//from w w w . j a va 2 s . c om }