[英]How do I make sure I get all the digits past the decimal out of Excel and into MySQL
I inherited a Java app that uses POI to read data from an Excel file into a MySQL DB. 我继承了一个Java应用程序,该应用程序使用POI将数据从Excel文件读入MySQL DB。 I'm noticing that cells that have numbers like 12.345678 are being read in as 12.3457 but I can't afford in this application to have the number rounded.
我注意到编号为12.345678的单元格被读为12.3457,但我无法在此应用程序中将数字四舍五入。
After some investigation it appears that my problem is not with POI. 经过一番调查,看来我的问题不是与POI有关。 I saw that the value was read with POI correctly, placed into the insert statement correctly, but when executed, the DB did not contain the full precision.
我看到正确地使用POI读取了该值,并正确地将其放置在insert语句中,但是在执行时,数据库不包含全精度。
I'm interested to hear the solution to your problem. 我很想听听您的问题的解决方案。 I had a similar issue when working with GIS coordinates.
使用GIS坐标时,我遇到了类似的问题。 My workaround was to stop working with Excel formatted files.
我的解决方法是停止使用Excel格式的文件。 I used CSV's where I could clearly tell all of the digits were present before sending to my database.
我使用CSV格式,在将其发送到数据库之前,我可以清楚地知道所有数字都存在。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.