If you want to format a number in a specific locale then you can use the NumberFormat class and specify your locale.
NumberFormat
NumberFormat nf = NumberFormat.getNumberInstance(Locale.GERMAN);
This gives you the comma as a decimal separator.