#5796 closed bug (wontfix)
Large Numbers in JSON Data get Truncated by $.getJSON
Reported by: | qurban1970 | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.4 |
Component: | ajax | Version: | 1.3.2 |
Keywords: | json, jsonp, cross-domain, truncate, numbers | Cc: | |
Blocked by: | Blocking: |
Description
When json data contains large numbers (eg: 413000000000000166743) as values in a key:value pair, they get truncated when returned by $.getJSON. This appears to be an intrinsic javascript problem for very large numbers. If I could stipulate in the function call that all data should be treated as text, then that should dodge the problem. And if I need a value to be a number, then javascript internal type-casting or the Number() function should be enough. For what it's worth, I encountered this when working with Zoho Creator ID values.
Change History (2)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Priority: | major → low |
---|---|
Resolution: | → wontfix |
Status: | new → closed |
This is a limitation of javascript, not jQuery. You can validly store numbers as strings, and convert them later.
To treat it as text would mean it would be invalidly formatted JSON.
What do native JSON parsers do with big numbers?