decimal value being truncated when exporting data to excel from asp.net c#
-
-
Hi, I am dynamically exporting data from asp.net page to excel format which works fine, but when I am exporting a float value 7.0 is being exported as 7 to the excel spread sheet. It is truncating the trailing zero and the decimal point. Thanks,
vijju
I assume there is something wrong with your code. Hard to say what, without seeing it.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Hi, I am dynamically exporting data from asp.net page to excel format which works fine, but when I am exporting a float value 7.0 is being exported as 7 to the excel spread sheet. It is truncating the trailing zero and the decimal point. Thanks,
vijju
-
Hi, I am dynamically exporting data from asp.net page to excel format which works fine, but when I am exporting a float value 7.0 is being exported as 7 to the excel spread sheet. It is truncating the trailing zero and the decimal point. Thanks,
vijju
That's likely only a formatting issue in Excel. What happens with non-integer values?
-
Does a value such as 7.01 also get truncated to 7? If not, and 7.01 shows up as 7.01 in Excel, then this is probably just a case of the default number format in Excel being 'General' which will cause values like 7.0, or 7.00, etc., to show up as 7 in Excel.
-
That's likely only a formatting issue in Excel. What happens with non-integer values?