Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
echo47 said:Please explain more clearly what you mean by "hex" and "decimal". Do you want to convert an ASCII string such as "12FC3B" into another ASCII string "1244219"? Or something else?
int val = b2 * 65536 + b1 * 256 + b0;
const int NUM_BCD = 8; // ffffff = 16,777,215 : 8 bcd digits max
int[] aBCD = new int[NUM_BCD]; // define an array to hold the BCD digits
int div = 10000000;
for(int n=NUM_BCD-1; n>=0; n--)
{
aBCD[n] = val/div; // get the integer
val = val % div; // use remainder for next calc
div = div/10;
}