[TIMOB-8911] iOS: JSON.parse decimal expansion
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Closed |
Resolution | Won't Do |
Resolution Date | 2020-01-10T18:06:22.000+0000 |
Affected Version/s | Release 2.1.0, Release 3.1.0 |
Fix Version/s | n/a |
Components | iOS |
Labels | community, core |
Reporter | scott vickers |
Assignee | Unknown |
Created | 2012-04-24T15:24:36.000+0000 |
Updated | 2020-01-10T18:06:22.000+0000 |
Description
When parsing objects with certain decimal values the resulting value is wrong.
var test = JSON.parse('{"Rating":8.2}');
Ti.API.info(test.Rating); //Yields 8.199999999999999
The above code gives the correct value on Android.
Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 6.0 Android Emulator: Android SDK version: 2.2
This issue is out of date with our current supported SDK release (7.5.2.GA as of the date of closure), and out of date with mobile OS versions. If community members feel that the issue is still valid, please create a new ticket. Please reference this closed ticket number, include SDK used, comments, and code that demonstrates/reproduces the issue.