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
B
类似 #2768, 解析带B后缀的数。
import com.alibaba.fastjson2.JSON; import org.junit.jupiter.api.Test; import java.util.HashMap; public class Test_1412 { @Test public void test1() { String str = "{\"k1\":123.456,\"k2\":12.34B}"; HashMap map = (HashMap) JSON.parseObject(str, Object.class); Object value = map.get("k2"); System.out.println(value); } @Test public void test2() { String str = "{\"k1\":123.456,\"k2\":12.34B}"; HashMap map = (HashMap) com.alibaba.fastjson.JSON.parseObject(str, HashMap.class); Object value = map.get("k2"); System.out.println(value); } }
fastjson 1.x: 12.34 fastjson2 2.0.51: -46
12.34
-46
The text was updated successfully, but these errors were encountered:
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
问题描述
类似 #2768, 解析带
B
后缀的数。环境信息
重现步骤
相关日志输出
fastjson 1.x:
12.34
fastjson2 2.0.51:
-46
The text was updated successfully, but these errors were encountered: