We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
数字0.123456789012345678在JavaScript不能精确表达,但是BigDecimal 0.123456789012345678 在 JSONWriter.Feature.BrowserCompatible 下不是输出字符串而是直接输出数字。
请填写以下信息:
下面代码输出结果是:{"num":0.123456789012345678},期望的结果是:{"num":"0.123456789012345678"}
BigDecimal num = new BigDecimal("0.123456789012345678"); JSONObject jsonObj = new JSONObject(); jsonObj.put("num", num); System.out.println(jsonObj.toString(JSONWriter.Feature.BrowserCompatible));
期望正确输出:{"num":"0.123456789012345678"}
The text was updated successfully, but these errors were encountered:
optimization writeBigInt & fix BrowserCompatible support, for issue #…
bf6193f
…2283
https://oss.sonatype.org/content/repositories/snapshots/com/alibaba/fastjson2/fastjson2/2.0.48-SNAPSHOT/ 问题已修复,请帮忙用2.0.48-SNAPSHOT版本帮忙验证,2.0.48版本预计在3月底前发布。
Sorry, something went wrong.
https://github.com/alibaba/fastjson2/releases/tag/2.0.48 请用新版本
No branches or pull requests
问题描述
数字0.123456789012345678在JavaScript不能精确表达,但是BigDecimal 0.123456789012345678 在 JSONWriter.Feature.BrowserCompatible 下不是输出字符串而是直接输出数字。
环境信息
请填写以下信息:
重现步骤
下面代码输出结果是:{"num":0.123456789012345678},期望的结果是:{"num":"0.123456789012345678"}
期待的正确结果
期望正确输出:{"num":"0.123456789012345678"}
相关日志输出
附加信息
The text was updated successfully, but these errors were encountered: