Ho to convert cell value to number?

Hi.

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?

Hi,


Below is linked Technical Article on this subject [Setting Number Formats].
http://www.aspose.com/documentation/java-components/aspose.cells-for-java/setting-display-formats-of-numbers-dates.html

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.