How to define and print hex/hexadecimal values in JS #5674
Unanswered
espruino-discuss
asked this question in
ESP8266
Replies: 1 comment
-
Posted at 2017-08-24 by @allObjects ...changing the conversation title to - for example - How to define and print hex / hexa decimal values would give it a good positive spin... ;) Posted at 2017-08-24 by @gfwilliams Just done... @user79559 thanks for posting up when you found the answer! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2017-08-23 by Alexandr
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
Beta Was this translation helpful? Give feedback.
All reactions