Free Support Forum -

Currency symbol when saving with ODS format is wrong in .NET

I have some problems with the currency symbol. Please check the code below:
Workbook workbook = new Workbook();

Worksheet sheet = workbook.Worksheets[0];

Range range = sheet.Cells.CreateRange(0, 0, 1, 1);

sheet.Cells[0, 0].Value = 1234.56;

Style style = workbook.CreateStyle();

style.Custom = "_-€ #,##0.00;[Red]_-€ -#,##0.00";

StyleFlag styleFlag = new StyleFlag() { NumberFormat = true };

range.ApplyStyle(style, styleFlag);

workbook.Save(myDir + "\\Test.xls");

workbook.Save(myDir + "\\Test.ods");

I added the two generated files. The currency symbol is saved correctly for the file with xls-format. But not for the one with ods-format.

When I save it under ods-format, I get a dollarsign when I open the file with excel and ‘BF’ (old Belgian currency) when I open it with Calc. 
What do I have to do to always get the Euro-symbol?

Hi Sophie,

Thank you for contacting Aspose support.

We have evaluated your presented scenario while using the latest version of Aspose.Cells for .NET, and we are able to see the problem with the currency symbol when saved in ODS format. Please note, the resultant XLS shows the correct currency symbol in Excel, that is Euro (€) but in case of ODS file, both Excel and OpenOffice Calc applications shows the symbol as Dollar ($). I believe the symbol is changed according to the machine’s locale when resultant ODS is loaded with OpenOffice Calc application. That could be the reason that you are getting ‘BF’ in Calc and I am getting a Dollar sign.

We have logged this incident in our bug tracking system under the ticket CELLSNET-43664 for further investigation & correction purposes. Please spare us little time to properly analyze the problem cause, and get back to you with updates in this regard.


Please try our latest version/fix: Aspose.Cells for .NET v8.4.2.2

We have fixed your issue now.

Let us know your feedback.

Thank you.

The issues you have found earlier (filed as CELLSNET-43664) have been fixed in this update.

This message was posted using Notification2Forum from Downloads module by Aspose Notifier.