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 is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
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)