Join Slack
Powered by
trying to run parseInt on 08 throws a NaN on UE sc...
# suitescript
n
NickSuite
11/04/2021, 7:00 PM
trying to run parseInt on 08 throws a NaN on UE script. Runs fine on console. type of variable that has value 08 is string.
NickSuite
11/04/2021, 7:10 PM
Fixed it.
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt
08 is considered as hexadecimal
s
stalbert
11/04/2021, 9:15 PM
I don't think that's true
n
NickSuite
11/05/2021, 4:33 AM
The documentation has this.
s
stalbert
11/05/2021, 2:49 PM
perhaps you mean '0X' not '08'?
n
NickSuite
11/05/2021, 4:35 PM
I mean... '08'
NickSuite
11/05/2021, 4:36 PM
Because parseInt('08') was throwing a NaN error. I fixed it by using parseInt('08', 10);
s
stalbert
11/05/2021, 4:51 PM
ok
Open in Slack
Previous
Next