Merge pull request #13112 from dataease/pr@dev-v2@fix_ds

fix(数据集): 修复小数类型字段出现科学计数的问题
This commit is contained in:
fit2cloudrd 2024-11-05 10:31:30 +08:00 committed by GitHub
commit 2df8441622
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -453,9 +453,9 @@ public class DatasetDataManage {
LinkedHashMap<String, Object> obj = new LinkedHashMap<>();
if (row.length > 0) {
for (int j = 0; j < fields.size(); j++) {
// 如果字段类型是数值类型的小数将结果保留8位小数同时去除科学计数
String res = row[j];
if (fields.get(j).getDeType() == 3) {
// 如果字段类型是数值类型的小数则去除科学计数
if (fields.get(j).getDeType() == 3 && StringUtils.containsIgnoreCase(res, "E")) {
BigDecimal bigDecimal = new BigDecimal(res);
res = String.format("%.8f", bigDecimal);
}