Here you can find the source of currency(double value, NumberFormat nformat)
protected static String currency(double value, NumberFormat nformat)
//package com.java2s; import java.text.NumberFormat; import java.util.Locale; public class Main { /**//w w w . j ava 2s . c om * Converts a number representing currency in the specified locale to a * displayable string. */ public static String currency(double value, Locale locale) { return currency(value, NumberFormat.getCurrencyInstance(locale)); } /** * Converts a number representing dollars to a currency display * string using the supplied number format. */ protected static String currency(double value, NumberFormat nformat) { return nformat.format(value); } }