chetan dhumane wrote:float f1 = 123.4567f;
Locale locFR = new Locale("fr"); // France
NumberFormat[] nfa = new NumberFormat[4];
nfa[0] = NumberFormat.getInstance();
nfa[1] = NumberFormat.getInstance(locFR);
nfa[2] = NumberFormat.getCurrencyInstance();
nfa[3] = NumberFormat.getCurrencyInstance(locFR);
for(NumberFormat nf : nfa)
System.out.println(nf.format(f1));
How numberformat class gets france locale in this example.(this example is from K&S book)
Thanks
only these two NumberFormat objects have france locale.
Others have default locale, I think that is US.