I have created a report using a word (docx) document as the template and I am trying to format the numbers using #,##0,## however the output uses # format instead. How can I fix this I used the value format in the report editor.
Your pattern seems incorrect, may be instead of last , should be . (#,##0.##)? Problem may be caused by default locale of your java. Symbol , means grouping separator in pattern string, but in different locales this separator can be different characters. May be in your locale this character is space, then formatted number 12345678 will be like 12 345 678. If it is not the case, could you please provide example of formatted number and version of Cuba platform in your project? Exported sample report will also help.
I made sure it is using the same as you said as I was using one from available parameters. I have uploaded a copy of the report. Receipt PDF.zip (92.6 KB)
To format numbers we use standard java.text.DecimalFormat and it should use your default locale. You could try to check what will happen when formatting numbers with DecimalFormat, the result should not differ from the one in the report.
The problem may be in GroupingSeparator and DecimalSeparator characters. You could get default locale using Locale.getDefault() method. Could you check which values getDisplayLanguage(), getDisplayCountry(), getLanguage() and getCountry() methods of default Locale instance will return?
I have used the functions as requested here is the results
defaultLocale.getDisplayLanguage(); English
defaultLocale.getDisplayCountry(); United States
defaultLocale.getLanguage(); EN
defaultLocale.getCountry(); US