hex

Is there a way to force Integer.toHexString(int i) to return 2 characters? If the hex value is less than 10, it is only returning one character. ie: 7 instead of 07
[171 byte] By [rewmagpoieaa] at [2007-11-27 8:19:16]
# 1
> Is there a way to force Integer.toHexStringI don't know, does Integer know voodoo?Thank you, I'll be here all night.
hunter9000a at 2007-7-12 20:07:23 > top of Java-index,Java Essentials,Java Programming...
# 2
Add a zero in front if it is only one character?
CaptainMorgan08a at 2007-7-12 20:07:23 > top of Java-index,Java Essentials,Java Programming...
# 3
int i = 7;String hex = String.format("%02x",i);~Tim
SomeoneElsea at 2007-7-12 20:07:23 > top of Java-index,Java Essentials,Java Programming...