Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-1407] Android: Number.toString() returns decimal "1.0"

GitHub Issuen/a
TypeBug
PriorityTrivial
StatusClosed
ResolutionFixed
Resolution Date2012-07-26T20:35:45.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.8.3
ComponentsAndroid
Labelsandroid, defect
ReporterDon Thorp
AssigneeNeeraj Gupta
Created2011-04-15T02:51:26.000+0000
Updated2017-03-06T23:49:56.000+0000

Description

Review the ECMA spec: http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-262.pdf"> http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-2... to see the rules on Number.toString().

Workaround: If you know the number you want is an integer, you use Math.floor(mynumber) instead of relying on the underlying JS's toString on every platform. We return a double from Titanium which is getting formatted as such.

Comments

  1. Josh Roesslein 2012-07-26

    This looks to be resolved for both Rhino and V8.
  2. Lee Morris 2017-03-06

    Closing ticket due to time passed.

JSON Source