+ 4
Number to Hex? In js or java or py.
ÂżComĂł convertir nĂșmero a Hexadecimal?Puede ser en javascript o en python.
4 Answers
+ 14
idk Python, but this how to do it in Java with only one line of code (we use the toHexString() method for this stuff):
int x = 42;
System.out.print(Integer.toHexString(x));
You can change it as per your choice, to convert a number to binary or octal, you can change it to Integer.toBinaryString(x) and Integer.toOctalString(x) respectively. ^_^
+ 4
thanks to both.
+ 3
Javscript:
var decimal = 128;
alert (Number(decimal).toString(16)); // output 80
+ 2
Excuse me . Maybe js or py or java. Any. Thanks.