benito.rios
10 May 2016, 7:47 AM
Hello,
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
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