|
I am trying to have nqBasic add the hex '0x' prefix to a 2-digit decimal number, without changing the two original 2 digit number. This is for use with a SPI driven 7-segment LED decoder driver (MC14489). The decimal number must always be 2-digits and range from 00 to 99 inclusive. Example1: decimal = 00, hex = 0x00. Example2: decimal = 12, hex = 0x12. Example3: decimal = 99, hex = 0x99. This may seem strange, but the MC14489 needs this particular formatting for its data. I'm unsure how to do it, other than having 100 case statements, one for each possible decimal value between 00 and 99. |