[TIMOB-23520] Android: parseInt() works in octal instead of decimal
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2016-06-17T02:57:09.000+0000 |
Affected Version/s | Release 5.3.0 |
Fix Version/s | n/a |
Components | Android |
Labels | android, parseInt |
Reporter | CREATIVE KAIZEN |
Assignee | Ashraf Abu |
Created | 2016-06-08T13:11:26.000+0000 |
Updated | 2017-03-24T18:01:01.000+0000 |
Hello, I am able to reproduce this issue with given code and given step. *Steps:* 1. Create a default classic project with folloing code.
2. Build and run the app on android device. Following log is produced:
Thanks *Environment*: *Device info:* HTC One (android 4.4.3) *Node.js Version:* 0.12.7 *npm Version:* 2.11.3 *Titanium SDKs:* 5.3.0.GA *Java Development Kit Version:* 1.8.0_73 *Titanium CLI Version:* 5.0.5 *Appcelerator CLI Version:* 5.2.2 *Appcelerator Studio:* 4.5.0
[~CREATIVE KAIZEN] This is a native javascript behaviour. Here's a related link: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt {quote}radix: Always specify this parameter to eliminate reader confusion and to guarantee predictable behavior. Different implementations produce different results when a radix is not specified, usually defaulting the value to 10.{quote} The best solution for this for now is thus
. Which is to specify the radix as base 10 aka decimal. This behavior will be updated to match the default expectation of decimal in the near future.
I'm going to resolve this ticket.
Closing ticket as invalid with reference to the above comments.