Click here to Skip to main content
15,885,244 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,
How to write in excel file using c#, ASP.Net? Actually I have written my data into excel file. But 0's before number are getting truncated when I open the output Excel file.
e.g. 001773 gets converted to 1773.

How to prevent this?

Thanks
Posted

1 solution

No, 001773 could not be "converted" to 1773. This is the same number.

You don't understand the difference between a number and its string representation, that's why you asked a question which makes no sense at all. If you want to represent a number as a string in certain way, you should learn formatting:
http://msdn.microsoft.com/en-us/library/dwhawy9k(v=vs.110).aspx[^],
http://msdn.microsoft.com/en-us/library/0c899ak8(v=vs.110).aspx[^].

—SA
 
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