@Test
public void testNumberFormat() throws ScriptException, NoSuchMethodException
{

    Map<String,Object> jsonObj = new HashMap<>();
    float f = 1.23456f;
    jsonObj.put("x", f);
    NumberFormat fmt = NumberFormat.getInstance();
    fmt.setMaximumFractionDigits(3);
    JSONConfig cfg = new JSONConfig().addNumberFormat(f, fmt);
    String json = JSONUtil.toJSON(jsonObj, cfg);
    validateJSON(json);
    assertThat(json, is("{\"x\":1.235}"));
}