Hi Isomorphic,
We are using Smart Gwt-5.1 (15th February build)
Browser: Google Chrome, version: 47.0.2526.106 m
Issue: Number format is differed from language to language.
We have a requirement like formatting number values into 'mm'(Millimeter). We followed two methods to format the number values. We observed that few languages like "French, German and Spanish" dot was replaced with comma.
Below is the code:
Method#1:
----------------------------------------
import com.google.gwt.i18n.client.NumberFormat;
Double measurementX = (double) ((112000) / 1000.00));
NumberFormat nfx = NumberFormat.getFormat("#,##0.00");
String output = nfx.format(measurementX);
Output:
In English: 112.00 >> Correct
In French: 112,00 >> Wrong (Dot is replaced with comma < 3rd position from right side).
--------------------------------------
Method#2:
---------------------------------------
import com.smartgwt.client.util.NumberUtil;
Double measurementX = (double) ((112000) / 1000.00));
String output = NumberUtil.format(measurementX, "#,##0.00");
Output:
In English: 112.00 >> Correct
In French: 112,00 >> Wrong (Dot is replaced with comma < 3rd position from right side).
--------------------------------------
Do let me know if any solution available.
Thanks & Regards,
We are using Smart Gwt-5.1 (15th February build)
Browser: Google Chrome, version: 47.0.2526.106 m
Issue: Number format is differed from language to language.
We have a requirement like formatting number values into 'mm'(Millimeter). We followed two methods to format the number values. We observed that few languages like "French, German and Spanish" dot was replaced with comma.
Below is the code:
Method#1:
----------------------------------------
import com.google.gwt.i18n.client.NumberFormat;
Double measurementX = (double) ((112000) / 1000.00));
NumberFormat nfx = NumberFormat.getFormat("#,##0.00");
String output = nfx.format(measurementX);
Output:
In English: 112.00 >> Correct
In French: 112,00 >> Wrong (Dot is replaced with comma < 3rd position from right side).
--------------------------------------
Method#2:
---------------------------------------
import com.smartgwt.client.util.NumberUtil;
Double measurementX = (double) ((112000) / 1000.00));
String output = NumberUtil.format(measurementX, "#,##0.00");
Output:
In English: 112.00 >> Correct
In French: 112,00 >> Wrong (Dot is replaced with comma < 3rd position from right side).
--------------------------------------
Do let me know if any solution available.
Thanks & Regards,
Comment