I've just created a bug for this: https://github.com/espruino/Espruino/issues/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 parseInt(a).toString(16)
© Espruino, powered by microcosm.
Report a problem