C
Cogito
Is there a javascript command to convert and display a variable in
hexadecimal and/or in binary?
hexadecimal and/or in binary?
Cogito said:Is there a javascript command to convert and display a variable in
hexadecimal and/or in binary?
Yes.
Cogito said:And the command is..?
It's not a command, it's a method.
var num = 42;
var hex = num.toString(16);
alert(hex);
alert(num.toString(2));
[...]While the city slept said:It's not a command, it's a method.
[...]It's not a command, it's a method.
Hang on... first your say "Yes" to the question "Is there a [...] command",
then you say "It's not a command"... so your first post was wrong? ;-)
Cogito said:Is there a javascript command to convert and display a variable in
hexadecimal and/or in binary?
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.