Change DecimalFormat locale
You can specify locale for DecimalFormat
this way:
DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.US);
DecimalFormat format = new DecimalFormat("##.########", symbols);
You may try by first converting to NumberFormat
and then Cast it to DecimalFormat
Integer vc = 3210000;
NumberFormat nf = NumberFormat.getNumberInstance(Locale.US);
DecimalFormat formatter = (DecimalFormat) nf;
formatter.applyPattern("#,###,###");
String fString = formatter.format(vc);
return convertNumbersToEnglish(fString);
You can use basic constructor for setting Locale while creating DecimalFormat object:
DecimalFormat dFormat = new DecimalFormat("#.#", new DecimalFormatSymbols(Locale.US));