Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
looly committed Sep 17, 2021
1 parent 9db1d17 commit 59be04e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2501,7 +2501,8 @@ public static double parseDouble(String number) {
}

/**
* 将指定字符串转换为{@link Number} 对象
* 将指定字符串转换为{@link Number} 对象<br>
* 此方法不支持科学计数法
*
* @param numberStr Number字符串
* @return Number对象
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

0 comments on commit 59be04e

Please sign in to comment.