简体   繁体   English

如何确保我将所有小数点后的所有数字从Excel导出到MySQL

[英]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.

相关问题 java有条件的我如何确保它检查所有的if语句 - java conditional how do I make sure it checks all if statements 如何让我的代码的最后一行打印小数点后 2 位的所有值? - How to I make the last line of my code print all values with 2 digits after decimal point? 如何编写单元测试以确保我的基于日期/时间的代码适用于所有时区以及有/无夏令时? - How do I write unit tests to make sure my date/time based code works for all time zones and with/out DST? 如何确定按钮已选中? - How do I make sure that the button is checked? 在JBoss应用程序服务器中,如何确保部署中的所有模块对jar库使用相同的Classloader? - In JBoss application server, how do I make sure that all modules in a deployment use the same Classloader for a jar library? 如果选择了“全部”选项,如何确保其他选项不运行? - if an option “ALL” is selected, how do I make sure other options does not run? 当我从另一个活动获得结果时,ListView仅更新一个视图项,如何获得所有过去的结果? - ListView is updating only one view item when I get the results from another activity, how do I get all the past results? 如何获得第 1 步最右边的数字? 那么我如何获得步骤 2 中未包含的数字? - How do I get the rightmost digits for step 1? Then how do I get the digits that weren't included for step 2? 如何获得小数点分隔符? - How do I get a decimal separator? 我如何将 2 位数字识别为分隔数字? - How do i recognize 2 digits as separated digits?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM