mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
Merge pull request !393 from 申劭明/I43U9G
This commit is contained in:
commit
c52ded8a02
@ -248,7 +248,13 @@ public class CellUtil {
|
||||
} else if (value instanceof RichTextString) {
|
||||
cell.setCellValue((RichTextString) value);
|
||||
} else if (value instanceof Number) {
|
||||
cell.setCellValue(((Number) value).doubleValue());
|
||||
// issue https://gitee.com/dromara/hutool/issues/I43U9G
|
||||
// 避免float到double的精度问题
|
||||
if (value instanceof Float) {
|
||||
cell.setCellValue(((Number) value).floatValue());
|
||||
} else {
|
||||
cell.setCellValue(((Number) value).doubleValue());
|
||||
}
|
||||
} else {
|
||||
cell.setCellValue(value.toString());
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user