We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Ho to convert cell value to number?


I’ve found that Cell.setNumber() method designing to change a cell format. But it really didn’t work. I write a method to recognize if cell value is Integer or Double. In case of Integer I set:
Style style = asposeCell.getStyle();
style.setNumber( 1 );
asposeCell.setStyle( style );
and if the value with floating point:

style.setNumber( 2 );

The result excel file still has a small green rectangle and excel suggest to convert cell value to a number. What I did wrong?


Below is linked Technical Article on this subject [Setting Number Formats].

Hopefully, you will not find any difficulties. If you do, then please share your input and output files. We will into them to provide you further guidance.
Thank you.

Thank you for reply. It helped me.