Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-8911] iOS: JSON.parse decimal expansion

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Do
Resolution Date2020-01-10T18:06:22.000+0000
Affected Version/sRelease 2.1.0, Release 3.1.0
Fix Version/sn/a
ComponentsiOS
Labelscommunity, core
Reporterscott vickers
AssigneeUnknown
Created2012-04-24T15:24:36.000+0000
Updated2020-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.

Comments

  1. Shameer Jan 2013-04-16

    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
  2. Alan Hutton 2020-01-10

    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.

JSON Source