Processing of jxl read currency type and scientific notation

Source: Internet
Author: User

Cell cell = sheet. getcell (J, I); // column, row
// If (cell. GetType () = celltype. Number | cell. GetType () = celltype. number_formula ){
// Numbercell NC = (numbercell) cell;
// Content = "" + NC. getvalue (); // The output is 1.23456789123456e17.
//} Else {
Content = cell. getcontents ();
//}

Numberformat NF = numberformat. getnumberinstance ();
Try {
Number = NF. parse (content );
Content = number. tostring ();
Bigdecimal BD = new bigdecimal (content );
Content = BD. toplainstring (); // jdk1.5 only 1.4 Use content = BD. tostring ();

} Catch (parseexception E1 ){
// System. Out. println ("encounter text ");
}

If a large number is encountered, the reading is still scientific notation, and the storage is also true, but the sum of the database is not affected.

The page only reads the database. The database is stable and what to read.

 

Reference

When poi and jxl are used to process big numbers, they are clicked and then converted into scientific notation.

Http://yuruli2058.blog.163.com/blog/static/17404752620101171172676/

Java numeric scientific notation http://jxdwuao.iteye.com/blog/698095

Http://goby2008.iteye.com/blog/137745 for formatting Java numbers, currency values, percentages, etc.

Java solution to scientific notation http://wenwen.soso.com/z/q156370981.htm

The simplest solution to the problem of changing the number to scientific notation when exporting an Excel file from the page

Http://www.cn-java.com/www1? 564158/viewspace-11333

The problem of scientific notation conversion http://topic.csdn.net/t/20040927/10/3411545.html

2009 Computer Level 2 Java: Convert double/double data from scientific notation to normal representation

Http://thea.cn/cs/learning/2008-9-17/103761-1.htm

Processing of unified Date Format and Digital scientific notation when parsing Excel using jxl

Http://hi.baidu.com/delete_h/blog/item/68737352b248a8050cf3e39f.html

Java checks whether a value is a number or integer and the corresponding regular expression.

Http://apps.hi.baidu.com/share/detail/33993681

How Java converts scientific notation http://www.iteye.com/problems/63638

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.