| Author |
Hexadecimal Conversion
|
Brusse James
Greenhorn
Joined: Nov 22, 2002
Posts: 7
|
|
|
This is probably way to easy, but does anyone have any suggestions as to how I can easily convert an integer input into hexadecimal. This assignment calls for the user to be able to enter a number from 0-100,000, and that number be converted to hex. There has to be an easier way of converting than a huge branching if...else if..etc. Any help appreciated
|
 |
Manish Hatwalne
Ranch Hand
Joined: Sep 22, 2001
Posts: 2559
|
|
Integer.toHexString(int_value_here); HTH, - Manish
|
 |
Brusse James
Greenhorn
Joined: Nov 22, 2002
Posts: 7
|
|
Manish, Thank you very much that worked perfectly, and saved me several pages. Brusse James
|
 |
Jim Ronholm
Greenhorn
Joined: Nov 15, 2002
Posts: 16
|
|
Or you could write an algorithm using / and % to convert it. (Previous answer was good, but there might come a time when you would need to do this yourself.) Jim
|
 |
 |
|
|
subject: Hexadecimal Conversion
|
|
|