Free Support Forum - aspose.com

Number Formatting issue when regional settings changed to Germany round off not wokring

Hi Team,

Can you please confirm us is Aspose 18.8 Jar java version supports Germany format attached images for your reference output with US and Germany, Below code we set to Germay to generate excel, it working fine with germany format but only round off is not working. Please look into this.

writeWorkbook.getSettings().setRegion(CountryCode.GERMANY);

In attached image, column name: Black Gross Margin value contains

US:- 32,661.01
image.png (13.8 KB)

Germay:- 3,266,101,103.00 (In Germany format round off not working)
Germany_Territory.png (7.1 KB)

Thanks
Jayaraj

@Jayaraj,

Thanks for the screenshots.

Please provide us your template files (input and output files) and paste your sample code (runnable) to show the issue. Also provide your desired with your expected formatted numeric data, you may create the file manually in MS Excel with some screeshots. We will check it soon.

Hi Team,

To generate the sample code(runnable) we need to change the regional settings to Germany, attached images with Germany and US, Once you generate excel using Aspose number columns are in round off values in US not in Germany. Please confirm whether round off will work in Germany format?
ex: open the attached images and refer Unit Cost column below are the formats.
In US format :- 201.76
US_format.jpeg (75.0 KB)

   In Germany format :- 201,76182 (Expecting in Germany 201,76)

Germany_format.jpeg (89.9 KB)

Note:- tried to create sample runnable code giving many errors for us. if you have any sample code please test the number columns. In our java file we are setting the below line.

Workbook excelWorkbook1 = new Workbook();
if(isGermany)
{
excelWorkbook1.getSettings().setRegion(CountryCode.GERMANY);
}

Please let us know if you have any questions.

Thanks
Jayaraj

@Jayaraj,

Thanks for the screenshots.

I did try your scenario/ case a bit. I am afraid, we could not evaluate or reproduce the issue on our end. We still appreciate if you could create a separate Java program (runnable) and provide your template files (input (if any) and output files) to reproduce the issue. Also, what numbers formatting is applied to the underlying cell(s)? I guess you may try by setting it using Style.setCustom(“0.00”) attribute and then check if the output looks ok or not in German locale.

Hi Team,
Thanks for your reply,
Yes, we use to set Style.setCustom(“0.00”) in our code, I am trying to attach excel files its not allowing to attach.
Just we need confirmation from Aspose java, For any number columns when we set to Germany format, whether round off will supports or not. Below is the sample format we are expecting.

Eg:-
In US format :- 201.76
In Germany format :- 201,76182 (Expecting in Germany 201,76)

note:- Germany Format got applied correct, But round of number column is not allowing.

Please let us know if you have any questions

Thanks
Jayaraj

@Jayaraj,

Well, it should work fine. By the way, why you are specifying the region. I mean if you are not converting your Excel file to PDF or image format, then you should not specify the region. So, you may skip setting the region (to Germany) and try again if it makes the difference or not. For your information, when you open the output Excel file in US or German locale, formatted data would be changed automatically when opening the Excel fie into it.

If you still could not evaluate, as requested earlier, kindly do provide the needful (please zip your template files and attach it here):