{ "id": "63634", "key": "TIMOB-3002", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2017-07-10T21:44:09.000+0000", "created": "2011-04-15T03:34:27.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "api" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-07-10T21:44:09.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "{html}
\r\ncurrentValue = 0.07;\r\n\r\n            var currentReadingValueLabel = Ti.UI.createLabel({\r\n                text: currentValue,\r\n                left: 110,\r\n                top: 22,\r\n                height: 'auto',\r\n                color: '#fff',\r\n                width: 150,\r\n                textAlign: 'left',\r\n                font:{\r\n                    fontSize: 24,\r\n                    fontStyle: 'bold'\r\n                }\r\n            });\r\n
\r\n

When displayed in both the iphone simulator and on the device\r\n(iPhone 3GS, iOS 4.1) I don't get just 0.07 but something like\r\n0.07000000000001. Using Dev 1.2.2 with iOS SDK 4.2 and Titanium\r\nMobile 1.5.1 (latest).

{html}", "attachment": [], "flagged": false, "summary": "iOS: Ti.UI.createLabel with text set as value of 0.07 gives 0.07000000000001", "creator": { "name": "lordsiris", "key": "lordsiris", "displayName": "lordsiris", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "lordsiris", "key": "lordsiris", "displayName": "lordsiris", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "129830", "author": { "name": "lordsiris", "key": "lordsiris", "displayName": "lordsiris", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Maybe this is just an issue with javascript decimal fraction\nprecision, but it's not clear since no arithmetic functions are\nbeing applied. Worked around the issue with currentValue =\ncurrentValue.toString();.

{html}", "updateAuthor": { "name": "lordsiris", "key": "lordsiris", "displayName": "lordsiris", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:34:27.000+0000", "updated": "2011-04-15T03:34:27.000+0000" }, { "id": "209925", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Confirmed SDK 2.2.0.014b86f. This is probably a rounding error due to us using 32-bit float instead of 64-bit.", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-07-26T15:27:16.000+0000", "updated": "2012-07-26T15:27:16.000+0000" }, { "id": "423807", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I am unable to reproduce this issue with the following environment;\r\niPhone 6 (10.0)\r\nStudio 4.9.0.201705302345\r\nTi SDK 6.1.1 GA\r\nAppc NPM 4.2.9\r\nAppc CLI 6.2.2\r\nTi CLI 5.0.14\r\nAlloy 1.9.11\r\nXcode 8.2 (8C38)\r\nNode v4.8.2\r\nJava 1.8.0_131", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-07-10T21:44:09.000+0000", "updated": "2017-07-10T21:44:09.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }