{ "id": "85795", "key": "TIMOB-7496", "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": "10100", "description": "This issue won't be actioned.", "name": "Won't Do" }, "resolutiondate": "2020-01-09T19:43:12.000+0000", "created": "2012-02-01T05:05:42.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "parity" ], "versions": [ { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2020-01-09T19:43:12.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": "10224", "name": "TiAPI", "description": "This component is used for cross-platform API work. Specifications are most likely to use this component." } ], "description": "h2. Problem\r\n\r\nFor consistency and parity, we need to decide how we should display numbers by default in the UI across all platforms. For example, the {{toString()}} method has always been necessary on Android when displaying a Number type that is an integer in a Label, to prevent it displaying as a float. iOS, on the other hand, displays it as an integer.\r\n\r\nWe should test all UI modules that are able to display text (for example, {{AlertDialog}}, {{TextField}}, {{OptionDialog}}) with an aim of making them consistent.\r\n\r\nh2. Test case\r\n\r\nThe code below returns these results:\r\n* Android displays 324.0\r\n* iOS displays 324\r\n\r\nNote that the {{Ti.API.info()}} statement confirms that {{label.text}} is a Number type on Android and iOS.\r\n\r\n{code:lang=javascript|title=app.js}\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor: 'white',\r\n\tfullscreen: false\r\n});\r\n\r\nvar bigNumber = 324;\r\nvar label = Ti.UI.createLabel({\r\n\tbackgroundColor:'green',\r\n\ttext: bigNumber,\r\n\ttextAlign: 'center'\r\n});\r\n\r\nwin.add(label);\r\nwin.open();\r\nTi.API.info('Label.text is type: '+typeof(label.text));\r\n{code}\r\n\r\n", "attachment": [], "flagged": false, "summary": "Ti API: UI - numbers displayed as float on Android and integer on iOS", "creator": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "subtasks": [], "reporter": { "name": "pdowsett", "key": "pdowsett", "displayName": "Paul Dowsett", "active": true, "timeZone": "Europe/London" }, "environment": "* Titanium 1.8.1\r\n* v8\r\n* Android 2.2, iOS 5", "comment": { "comments": [ { "id": "246637", "author": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "body": "It would be great if we can wrap up one of the last major parity issues in 3.2", "updateAuthor": { "name": "iotashan", "key": "iotashan", "displayName": "Shannon Hicks", "active": true, "timeZone": "America/Chicago" }, "created": "2013-04-09T15:23:04.000+0000", "updated": "2013-04-09T15:23:04.000+0000" }, { "id": "246658", "author": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Few quick comments. \n\nThere is no typeof method, it's just an operator. Wrapping parens around it works fine, but it's superfluous. It's like doing \n{code}\n3 + (4)\n{code}\nIt's better to do typeof label.text instead of typeof(label.txt)\n\nAs far as the point at hand, I wonder if this is actually a parity bug in our code, or just a difference in V8 and JSCore.", "updateAuthor": { "name": "bhughes", "key": "bhughes", "displayName": "Bryan Hughes", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-09T17:35:41.000+0000", "updated": "2013-04-09T17:35:41.000+0000" }, { "id": "453586", "author": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "body": "It has been decided that this issue should be closed as “Won’t do.” 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. \r\n\r\nIf 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.", "updateAuthor": { "name": "ahutton", "key": "ahutton", "displayName": "Alan Hutton", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2020-01-09T19:43:12.000+0000", "updated": "2020-01-09T19:43:12.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }