diff --git a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java b/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java index 52bb135fca..c5bf25e57f 100644 --- a/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java +++ b/hutool-core/src/main/java/cn/hutool/core/util/NumberUtil.java @@ -2501,7 +2501,8 @@ public static double parseDouble(String number) { } /** - * 将指定字符串转换为{@link Number} 对象 + * 将指定字符串转换为{@link Number} 对象
+ * 此方法不支持科学计数法 * * @param numberStr Number字符串 * @return Number对象 diff --git a/hutool-core/src/test/java/cn/hutool/core/util/NumberUtilTest.java b/hutool-core/src/test/java/cn/hutool/core/util/NumberUtilTest.java index 5f8603999d..ffdbd953e3 100644 --- a/hutool-core/src/test/java/cn/hutool/core/util/NumberUtilTest.java +++ b/hutool-core/src/test/java/cn/hutool/core/util/NumberUtilTest.java @@ -393,4 +393,11 @@ public void generateRandomNumberTest2(){ final Set set = Convert.convert(Set.class, ints); Assert.assertEquals(7, set.size()); } + + @Test + public void toPlainNumberTest(){ + String num = "5344.34234e3"; + final String s = new BigDecimal(num).toPlainString(); + Assert.assertEquals("5344342.34", s); + } }