mirror of
https://gitee.com/dromara/hutool.git
synced 2025-04-22 12:01:41 +08:00
fix bug #I43U9G
This commit is contained in:
parent
89e412d985
commit
6a5a026c00
@ -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…
Reference in New Issue
Block a user