Click here to Skip to main content
15,667,014 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:

I am trying to enter numbers in excel cells programatically. I have number formatting code in side my c# program. As a result numbers have differnt decimal places. e.g 12.1200, 2.000, 100.0 etc.

When I print these values in excel, it changes the number of decimal places. How do I ensure that my numbers have same decimal places as I print then. I do not want to change the cells from number to text.
Updated 27-Jul-10 22:39pm

1 solution

I think you need to set the number format for each cell. Microsoft has a piece of sample code here[^].
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900