Free Support Forum - aspose.com

Cell formating not taking

i populate a cell via aspose.excel

xlsSheet.Cells(sTemp).PutValue(UseThis)

usethis has the value of 0.8 and the formating of the cell is percentage

when everything is done and saved the cell shows 0.8 and not 80%

if i manually got back , select the cell and hit enter the 0.8 changs to 89%

how can i make sure the formating is being applied when cell values are entered?

thanks

mike

UseThis variable is a string, not a double, right? If you use the following code:

cell.PutValue("0.8");

This string is written to the file as text. Number format will not take effect.

To make it work as your wish, you can try:

cell.PutValue(0.8);

or

cell.PutValue("0.8", true);