This commit is contained in:
Looly
2021-06-16 23:06:00 +08:00
parent ec60a4202d
commit b9cf8b0c5b
2 changed files with 12 additions and 5 deletions

View File

@@ -223,4 +223,11 @@ public class JSONUtilTest {
final JSONObject set = JSONUtil.createObj().set("test", new SQLException("test"));
Assert.assertEquals("{\"test\":\"java.sql.SQLException: test\"}", set.toString());
}
@Test
public void parseBigNumberTest(){
// 科学计数法使用BigDecimal处理默认输出非科学计数形式
String str = "{\"test\":100000054128897953e4}";
Assert.assertEquals("{\"test\":1000000541288979530000}", JSONUtil.parseObj(str).toString());
}
}