View Full Version : [OPEN] NumberField and Currencies in Switzerland problem

10 May 2016, 7:47 AM

In Switzerland, a currency number looks like "CHF 10'000.00". The apostrophe is used as the grouping separator.

I think NumberField gets confused with the apostrophe because it shows "CHF 10", and all the digits to the right of the grouping character don't appear.

As a workaround, I'm using a custom currency format, which is the same as the default currency format but without grouping separator:

// The default currency format for this locale (de_CH) is "\u00A4\u00A0#,##0.00;\u00A4-#,##0.00"
// private static NumberFormat systemCurrencyFormat = NumberFormat.getCurrencyFormat(SystemInfo.getCurrencyCode()).;

private static NumberFormat systemCurrencyFormat = NumberFormat.getFormat("\u00A4\u00A0#0.00;\u00A4-#0.00", SystemInfo.getCurrencyCode());

And with this, the NumberField shows "CHF 10000.00", not perfect but better than "CHF 10".

By the way, I'm using GXT 4.0.1

Thank you very much in advance

13 May 2016, 1:25 PM
Thanks for the report! I have opened a bug in our bug tracker.

13 May 2016, 1:25 PM
Did you need some help getting around the issue?