tostring(10) does not work.
I'm trying to convert hex to dec, what's the problem?
My code:
print((31).toString(10)); //returns 31
print((31).toString(16)); //returns 1f
figured out th problem by myself :)
it is necessary to write so:
print((0x31).toString(10)); // returns 49
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.
tostring(10) does not work.
I'm trying to convert hex to dec, what's the problem?
My code:
print((31).toString(10)); //returns 31
print((31).toString(16)); //returns 1f
figured out th problem by myself :)
it is necessary to write so:
print((0x31).toString(10)); // returns 49