// 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.text.DecimalFormat;
import java.text.DecimalFormatSymbols;
import java.text.NumberFormat;
import java.util.Locale;

public class NumFmt {
    public static void main(String[] args) {
        NumberFormat fmt = new DecimalFormat("#,###,###");
        System.out.println(fmt.format(123456789));
        NumberFormat fmtdk = new DecimalFormat("#,###,###", new DecimalFormatSymbols(new Locale("da", "dk")));
        System.out.println(fmtdk.format(123456789));
    }
}
