use POI to read the Excel file and read the phone number into 1.3471022771E10 [problem points: 40 points, knot person Xieyongqiu]Do not show delete repliesShow All repliesShow star replyShow score ReplyOnly show landlordCollection
-
-
concern
-
Xie Yongqiu
-
maobingxixi
-
version level:
-
Knot rate: 71.43%
-
|
landlord posted: 2010-09-13 17:33:03 Read poi using excel file, read phone number turn 1.3471022771E10 how fix? more 2 Share to: |
| Useful to me [0] throw a brick [0] reference | Report | Management number of replies: |
-
concern
-
Eemean
-
Eemean
-
This edition level:
|
#1 Score: 5 replies.: 2010-09-13 17:34:34 You have to judge more, CELL type seems to have four types, |
| Useful to me [0] throw a brick [0] reference | Report | Management |
-
concern
-
Xieyongqiu
-
Maobingxixi
-
This edition level:
|
#2 Score: 0 replies.: 2010-09-13 17:41:35
if (cell.getcelltype () = = Hssfcell.cell_type_numeric) {
DateFormat format = new SimpleDateFormat (DATEUTIL.YYYY_MM_DD);
if (hssfdateutil.iscelldateformatted (cell)) {
is a date type
str = Format.format (Cell.getdatecellvalue ());
} else {
Whether it is a numeric type
Double d = cell.getnumericcellvalue ();
if (d-(int) d < double.min_value) {
is an int type
str = integer.tostring ((int) d);
} else {
System.out.println ("Double ...");
is a double type
str = double.tostring (Cell.getnumericcellvalue ());
}
}
System.out.println ("type==" +cell.getcelltype ());
System.out.println ("cell==" +str);
}else if (cell.getcelltype () = = hssfcell.cell_type_string) {
str = Cell.getrichstringcellvalue (). getString ();
}else if (cell.getcelltype () = = Hssfcell.cell_type_formula) {
str = Cell.getcellformula ();
}else if (cell.getcelltype () = = Hssfcell.cell_type_blank) {
str = "";
}else if (cell.getcelltype () = = Hssfcell.cell_type_error) {
str = "";
}
These types are judged, still 1.3471022771E10.
|
| Useful to me [0] throw a brick [1] reference | Report | Management |
-
concern
-
Xieyongqiu
-
Maobingxixi
-
This edition level:
|
#3 Score: 0 replies.: 2010-09-13 17:51:55 solved is a conversion problem
Converting a mobile number that is represented as 1.3922433397E10 to 13922433397 is not necessarily the best way to convert
DecimalFormat df = new DecimalFormat ("#");
System.out.println ("type666==" +df.format (Cell.getnumericcellvalue ())); |
Use POI to read the Excel file and read the phone number into 1.3471022771E10