Nf() issue with decimal point

One more script you could try with your old / clean settings (which hopefully might show something unexpected) -

import java.util.Locale;

float f = 1.23;
String s = nf(f, 0, 1);
println(s);  // Prints "1,2"
println(Locale.getDefault());
println(Locale.getDefault(Locale.Category.DISPLAY));
println(Locale.getDefault(Locale.Category.FORMAT));

It is the value of the last line that should be affecting the output.

2 Likes