// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.math.*;
import java.text.*;
import java.util.*;

public class BDF {
    public static void main(String[] args) {
        BigDecimal x = new BigDecimal("12345.6");
        System.out.println(x);
        x = x.setScale(2);
        System.out.println(x);
        double xx = x.doubleValue();
        NumberFormat nf1 = NumberFormat.getInstance(new Locale("da", "dk"));
        System.out.println(nf1.format(xx));
        NumberFormat nf2 = new DecimalFormat("#,##0.00", new DecimalFormatSymbols(new Locale("da", "dk")));
        System.out.println(nf2.format(xx));
        System.out.println(nf2.format(x)); // ????
    }
}
