Friday, May 9, 2008

XLS.Misc - When opening file with excel the numbers appear in scientific notation (exponential)

Problem: numbers appear in scientific notation (exponential) in document excel in file generated from Genexus.

This file is generated like a file with Tags HTML and engraving with extension xls.

That it is the scientific format:
The Scientific format shows a number in exponential notation, replacing part of the number with E+n, where E (that means Exponent) multiplies the number previous by 10 to the nth power. For example, a scientific format with two decimal shows 12345678901 like 1.23E+10, that is 1.23 times 10 to the tenth power.

Answer:
The answer is that excel uses the General format.

The General format uses the exponential notation for the great numbers (of 12 digits or more).

In order to clear the exponential notation in the great numbers, it can apply different a numerical format, like Number. This is in manual form.

Another alternative is to add some character (apostrophe, # or what is) to tag HTML that contains the number so that excel takes it like text.

The HTML would be thus:


<Table>
<Tr>
<Td>'1234567890111111</td>
<Td>'1234567890111111 </td>

</Tr>
</Table>



and it would be seen like Image 1.




On the other hand if what is desired to show are number of credit card, the number with the intermediate spaces could be recorded. Of that form excel understands it as character and shows it well.

The HTML would be thus:


<Table>
<Tr>
<Td>1234 5678 9011 1111</td>
<Td>1234 5678 9011 1111 </td>

</Tr>
</Table>



And it would be seen like Image 2.




At least with this it is left the reason by which this happens, and single subtraction to find other alternatives of solution if clear this does not satisfy.

Welcome commentaries to solve this subject!


View original link http://mundosupport.blogspot.com/2008/05/xlsvarios-al-abrir-archivo-con-excel.html

No comments: