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

public class NumFmt {
    public static void main(String[] args) throws ParseException {
        String s = "1.050,52";
        NumberFormat nf1 = new DecimalFormat("#,000.00", DecimalFormatSymbols.getInstance(new Locale("da", "dk")));
        System.out.println(nf1.parse(s));
        NumberFormat nf2 = NumberFormat.getInstance(new Locale("da", "dk"));
        System.out.println(nf2.parse(s));
    }
}
