This commit is contained in:
Looly
2020-10-09 15:43:57 +08:00
parent 308fa0f9db
commit 7f83e35307

View File

@@ -154,4 +154,11 @@ public class JSONUtilTest {
Assert.assertEquals("aa", json.get("name")); Assert.assertEquals("aa", json.get("name"));
Assert.assertEquals(1, json.get("gender")); Assert.assertEquals(1, json.get("gender"));
} }
@Test
public void doubleTest(){
String json = "{\"test\": 12.00}";
final JSONObject jsonObject = JSONUtil.parseObj(json);
Assert.assertEquals("12.00", jsonObject.getBigDecimal("test").setScale(2).toString());
}
} }