Here you can find the source of expFormatRupiah(Number input, boolean prependRp)
public static String expFormatRupiah(Number input, boolean prependRp)
//package com.java2s; //License from project: Open Source License import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; import java.text.NumberFormat; public class Main { private static DecimalFormat rupiahFormat; public static String expFormatRupiah(Number input, boolean prependRp) { if (rupiahFormat == null) { DecimalFormatSymbols decimalFormatSymbols = new DecimalFormatSymbols(); decimalFormatSymbols.setCurrencySymbol(prependRp ? "Rp " : ""); decimalFormatSymbols.setMonetaryDecimalSeparator(','); decimalFormatSymbols.setGroupingSeparator('.'); rupiahFormat = (DecimalFormat) NumberFormat.getCurrencyInstance(); rupiahFormat.setDecimalFormatSymbols(decimalFormatSymbols); }/*w w w .j a va 2s . c om*/ return rupiahFormat.format(input); } }