Currency

0
More

Format Currency Rupiah pada Java

  • 2019-06-04

Import file: import java.text.DecimalFormat; import java.text.DecimalFormatSymbols; Format: DecimalFormat id = (DecimalFormat) DecimalFormat.getCurrencyInstance(); DecimalFormatSymbols rp = new DecimalFormatSymbols(); rp.setCurrencySymbol(“Rp”); rp.setMonetaryDecimalSeparator(‘,’); rp.setGroupingSeparator(‘.’); id.setDecimalFormatSymbols(rp); Double harga = 1000,10; id.format(harga);