Here you can find the source of getCurrencyDisplay(Object amount)
public static String getCurrencyDisplay(Object amount)
//package com.java2s; /*//from www . j a va2s . co m * This software is distributed under the terms of the FSF * Gnu Lesser General Public License (see lgpl.txt). * * This program is distributed WITHOUT ANY WARRANTY. See the * GNU General Public License for more details. */ import java.text.NumberFormat; public class Main { public static String getCurrencyDisplay(Object amount) { String display = ""; try { if (amount != null && !isEmpty(amount)) display = NumberFormat.getCurrencyInstance().format(amount); } catch (IllegalArgumentException ie) { } return display; } public static String getCurrencyDisplay(double amount) { return getCurrencyDisplay(new Double(amount)); } /** * Checks if a data object is empty. An empty object is either null or an * empty string. * * @param data the data to check * @return true if the data object is not empty */ public static boolean isEmpty(Object data) { if (data == null || "".equals(data.toString())) return true; return false; } }