tags:

views:

379

answers:

1

I'm working with NumberField and NumberFormat. How can I change NumberConstants.decimalSeparator() value without changing my locale? For instance I want to have "." or "," as decimal separators for all locales. Is it possible to create custom property file NumberConstants_bla.properties and force gxt use it instead of standard NumberConstants_ru_RU.properties or NumberConstants_en_US.properties (depending on current locale)? Where should I place this file to?

+1  A: 

In Java you can set the decimal separator using DecimalFormatSymbols.

// default symbols for the locale
DecimalFormatSymbols decimalFormatSymbols = DecimalFormatSymbols.getInstance();
// set your required separator
decimalFormatSymbols.setDecimalSeparator(',');
// create a decimal format and set your symbols
DecimalFormat format = new DecimalFormat();
format.setDecimalFormatSymbols(decimalFormatSymbols);
Mark
Infortunatly it's not an option for com.google.gwt.i18n.client.NumberFormat :(
sandlex
Ah just noticed the GWT tag. No experience there so can't suggest anything else.
Mark