Java tutorial
import java.math.BigDecimal; import java.text.NumberFormat; import java.util.Locale; public class Main { public static void main(String[] args) { BigDecimal payment = new BigDecimal("12345.67"); NumberFormat n = NumberFormat.getCurrencyInstance(Locale.US); double doublePayment = payment.doubleValue(); String s = n.format(doublePayment); System.out.println(s); } }