i just need to be able to convert a (maximum) 3 digit decimal number to hex
Is this the best way to do it, or is there a simple way that i dont see?
(excluding any built in hex functionality for java)
public String fullConversion(int n) { String result = ""; result += convertSingleNumber(n/256); n = n%256; result += convertSingleNumber(n/16); n = n%16; result += convertSingleNumber(n); return result; } private String convertSingleNumber(int i) { String hex=""; if(i > 9) { hex += (char)('A'+((i%10))); } else hex += i; return hex; }