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
L
{"value": 1.23L}整体会解析为long,得到123
{"value": 1.23L}
import com.alibaba.fastjson2.JSON; import com.alibaba.fastjson2.JSONObject; import org.junit.jupiter.api.Test; public class Test_1041 { @Test public void test() { String jsonStr = "{\"value\": 1.23L}"; JSONObject jsonObject = JSON.parseObject(jsonStr); Long result1 = jsonObject.getLong("value"); Float result2 = jsonObject.getFloat("value"); String result3 = jsonObject.getString("value"); System.out.println(result1); System.out.println(result2); System.out.println(result3); } }
fastjson 1.x: 1 1.23 1.23
fastjson2 2.0.51: 123 123.0 123
The text was updated successfully, but these errors were encountered:
B
1.23L
123
fix adjust readNumber0 for decimal with suffix of B,S or L, for issue #…
38e441e
…2769 and #2768
261688f
https://github.com/alibaba/fastjson2/releases/tag/2.0.52 问题已修复,请用新版本
Sorry, something went wrong.
yanxutao89
No branches or pull requests
问题描述
{"value": 1.23L}
整体会解析为long,得到123环境信息
重现步骤
相关日志输出
fastjson 1.x:
1
1.23
1.23
fastjson2 2.0.51:
123
123.0
123
The text was updated successfully, but these errors were encountered: