Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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);
    }
}