Currency Format is not applied for field with "Value" Type

Hi Team,

We are facing the issue on displaying the integer value in the format of Currency. See below description.

We have the excel generated using Aspose. In the generated sheet, Cell have the value like “10” in the cell with the format as “Currency” type using set style. “D” column have the values.

Style cellstyle = sheet.Cells[“D” + j].GetStyle();
cellstyle.Custom = “[$$-409]#,##0.0000”;
cellstyle.SetCustom(cellstyle.Custom, true);

The selected currency style is set and displayed in the “Number Format Bar” in the Excel but the value is not displayed with the format even though the value contains the integer value “10”.

If we use the format painter of the respective cell and copied into another cell. the copied cell data is displaying the value with the right format.

Appreciate if you provide the suggestion at the earliest.

Thanks in advance

@Kalpana_K

Thanks for using Aspose APIs.

Please try the following code. It works fine. Please see the output Excel file generated by the code and screenshot showing the output for a reference.

Download Link:
Output Excel File.zip (5.6 KB)

C#

Workbook wb = new Workbook();

Worksheet ws = wb.Worksheets[0];

Cell cell = ws.Cells["B4"];
cell.PutValue(10);

Style st = cell.GetStyle();
st.Custom = "[$$-409]#,##0.0000";
cell.SetStyle(st);

wb.Save("output.xlsx");

Screenshot: