Dear Aspose!
merge field definition
{ MERGEFIELD C12628_0 \# "### ### ### ### ##0.0000" \* MERGEFORMAT }
Value: 35000
The output with 24.4
The output with 24.5
Hungarian locale/environment.
Thank you!
Dear Aspose!
merge field definition
{ MERGEFIELD C12628_0 \# "### ### ### ### ##0.0000" \* MERGEFORMAT }
Value: 35000
The output with 24.4
The output with 24.5
Hungarian locale/environment.
Thank you!
The number formatting issue you are experiencing with the mail merge in version 24.5 is likely due to changes in how formatting is handled in that version. Here’s how to address the problem:
Cause: The issue may stem from the locale settings or changes in the formatting rules in version 24.5.
Solution:
MERGEFIELD C12628_0 \# "0.0000" \* MERGEFORMAT
Next Steps:
Please follow these steps, and let me know if you need further assistance!
The customer has control over formatting, we don’t have control.
@EPluribusUnum Which culture is used? Could you please attach sample input and output documents along with simple code that will allow us to reproduce the problem? We will check the issue and provide you more information.
@alexey.noskov , culture does not help here, the IFieldUpdateCultureProvider not called. It supports only date/time. (see : FieldOptions | Aspose.Words for Java )
Attached the example code, dotx and output generated with Asposw.words with 24.4 and 24.5.
317137.zip (32.5 KB)
@EPluribusUnum The output is actually expected for Hungarian culture. In hu-HU
locale coma is used as decimal separator. But in your mergefield dot is specified as decimal separator:
{ MERGEFIELD NUM \# "### ### ### ### ##0.0000" \* MERGEFORMAT }
To get the expected value in Hungarian culture you should change format code like this:
{ MERGEFIELD NUM \# "### ### ### ### ##0,0000" \* MERGEFORMAT }
// Set locale
Locale current = CurrentThreadSettings.getLocale();
CurrentThreadSettings.setLocale(Locale.forLanguageTag("hu-HU"));
DataTable dt = new DataTable("TABLE");
dt.getColumns().add("NUM");
dt.getRows().add(35000);
Document doc = new Document("C:\\Temp\\in.docx");
doc.getMailMerge().executeWithRegions(dt);
doc.save("C:\\Temp\\out.pdf");
// Restore locale.
CurrentThreadSettings.setLocale(current);
Checked in MS Word. It behaves as 24.5, not as 24.4.
So this break was due to follow MS Word behaviour.