Hi,
Assuming that this is a Report Designer layout, the date number formatting is done based on the Java locale of the locale passed when printing or previewing. So if this is different then I has to be the Standard Java formatting for that locale.
You can edit the layout and give you custom negative number format and symbol without making it work based on the locale. However, as this is a hardcoded value it will be the same for all locales and languages.
Hope this helps,
Hi Chanaka,
Thanks for the answer. hardcoding the negative number format seems to work!
But seems it’s not the standard java formatting causes the difference. If you check the sample section for Number formatting popup in report designer, it does’t show any significant difference for negative and positive formats for swedish and english.
I tried this sample to verify the java formatting out of curiosity
NumberFormat swedishNumberFormat = NumberFormat.getInstance(new Locale("sv", "SE"));
NumberFormat englishNumberFormat = NumberFormat.getInstance(new Locale("en","US"));
Number val = -123456.789;
System.out.println("Swedish format " + swedishNumberFormat.format(val));
System.out.println("English format " + englishNumberFormat.format(val));
output
Swedish format -123 456,789
English format -123,456.789
Cheers!
Hi,
Thanks for testing and for the clarification. What I meant by Java formatting is the format that is output by the Java utility library we use to format numbers which is a 3rd party one library. Maybe there is a fault in it. If you want, please create a support issue for this and we can further investigate it.
Regards,
Hi,
Thanks for testing and for the clarification. What I meant by Java formatting is the format that is output by the Java utility library we use to format numbers which is a 3rd party one library. Maybe there is a fault in it. If you want, please create a support issue for this and we can further investigate it.
Regards,
Hi Chanaka,
Thanks for getting back. Your answer worked well for the problem and no we don’t need to create a support case.
Cheers!