Here you can find the source of currencyFormat()
public static NumberFormat currencyFormat()
//package com.java2s; import java.text.NumberFormat; public class Main { public static NumberFormat currencyFormat() { NumberFormat format = NumberFormat.getNumberInstance(); format.setMaximumFractionDigits(2); format.setMinimumFractionDigits(2); return format; }//from w ww. j av a 2s .co m }