Here you can find the source of formatMoney(String money)
public static String formatMoney(String money)
//package com.java2s; //License from project: Apache License import java.text.DecimalFormat; import java.text.NumberFormat; public class Main { public static String formatMoney(double d) { DecimalFormat format = (DecimalFormat) NumberFormat.getPercentInstance(); format.applyPattern("###########0.00"); return format.format(d); }/*from w ww . j ava2s .c om*/ public static String formatMoney(String money) { if (money == null) return ""; try { money = money.trim(); double d = Double.parseDouble(money); return formatMoney(d); } catch (Exception e) { System.err.println(e); } return money; } }