Free Support Forum - aspose.com

Number formatting not working

I want to use below format,it is working in excel but when i use with aspose it is not working.

cells.Item(intRowCounter, 5).Style.Custom = "$#,##0_);[Red]($#,##0)"

I want cell value should look like below if value is less than 0.

($127)

Thanks,

Arun

I tested with the following code and all work fine:

Excel excel = new Excel();
Cell cell = excel.Worksheets[0].Cells["A1"];
cell.Style.Custom = "$#,##0_);[Red]($#,##0)";
cell.PutValue(-12.34);
excel.Save("d:\\test\\abc.xls");

VB code:

Dim excel As Excel = New Excel()
Dim cell As Cell = excel.Worksheets(0).Cells("A1")
cell.Style.Custom = "$#,##0_);[Red]($#,##0)"
cell.PutValue(-12.34)
excel.Save("d:\test\abc.xls")

Hi,

code is not working,is there any problem with office 2003.

Thanks,

Arun

I attached the output file with my sample code here. Please check it.

Hi,

Thanks,It is working fine now.

Thanks,

Arun