gpt4 book ai didi

java - Apache Poi : Getting scientific notated double value in place of Numeric value

转载 作者:行者123 更新时间:2023-12-02 03:16:24 24 4
gpt4 key购买 nike

我的实际号码是:“89148000001958100000”(即)Excel列数据,通过apahce poi插件获取数据后,它转换为8.91480000019581E+019。

转换代码片段:

导入org.apache.poi.ss.usermodel.Cell;

double dd = cell.getNumericCellValue();

如何在 Excel 文件中获得我的实际数字。

请提出建议...

最佳答案

DataFormatter fmt = new DataFormatter();


String value= fmt.formatCellValue(cell);

您可以使用 DataFormatter 显示 Excel 中的值

您还可以使用 BigDecimal 或 BigInteger 类将 String 转换为所需格式以保存更大的值

关于java - Apache Poi : Getting scientific notated double value in place of Numeric value,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40219623/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com