number.toString(base) sometimes ignores argument #200
Replies: 3 comments
-
Posted at 2014-02-11 by @gfwilliams I've just created a bug for this: espruino/Espruino#232 It's more obvious if you do this:
The issue is that floats and integers are treated slightly differently in Espruino. Floats are only output in decimal (at the moment), whereas integers can be output in whatever base is requested. So if you want to work around it, for now I'd suggest doing |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-02-11 by randunel I don't know about Espruino, but in every JS interpreter I've come accross, |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-02-11 by @gfwilliams First off, while And no... To be honest if you wanted to be faster, you'd do But it's a bit pointless now, because I just fixed the original bug. It'll be in 1v51 :) |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-02-11 by DrAzzy
Can anyone explain what's going on here?
scancolor=0
Why is the argument to toString() being ignored in the second case?
Other JS interpreters don't seem to have this behavior.
Beta Was this translation helpful? Give feedback.
All reactions