Export CSV file number will automatically change the method of scientific counting

Source: Internet
Author: User
To export data to Excel files into scientific notation questions:

Analysis: The CSV file exported by the program, when the field has a relatively long number of fields exist, in the use of Excel software to view the CSV file will become the form of scientific and technological law.
In fact, this question is not related to what language to export CSV files. When Excel displays a number, if the number is greater than 12 digits, it is automatically converted to scientific notation; If the number is greater than 15 digits, it is not only used in the scientific and technical law, but it will retain only a high of 15 bits, and the other bits are 0.


Workaround: (as long as the number field followed by the display of invisible characters, the end of the String plus tab "T")

For example: The PHP program can be so judged, note must be "\ T", not ' t '.
Is_numeric ($exporVal)? $exporVal. "T": $exporVal;


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.