A BUG json-lib's, Float Data distorted

 Using a json-lib2.1, I do not know whether the new version has been resolved, but this version does have this problem.

Float data type defined in Action, after packaging into JSON distorted,

For example, 0.1 becomes .1000000000149.

Some say json-lib when the Float Double to deal with, which leads to the occurrence of this phenomenon.

The solution is not to use Float type, but with a Double.

Reproduced in: https: //my.oschina.net/cjkall/blog/195925

Guess you like

Origin blog.csdn.net/weixin_33991727/article/details/91756475