Exact match. Not showing close matches.
PICList
Thread
'[PIC]: 32bit binary to ASCII conversion'
2000\06\08@084956
by
Octavio Nogueira
If you want the routine in C here it is:
/*--------------------------------------------*/
/* d - number to display */
/* dig - number of digits */
/* dec - decimal point position */
/*--------------------------------------------*/
void print(unsigned long d, char dig, char dec)
{
unsigned long n;
char i,j;
n=1;
for(i=dig;i!=1;i--) n*=10;
while(n!=1)
{
if(d>=n)
{
j=(d/n) % n;
putch(j+0x30);
d-=j*n;
}
else
putch('0');
n/=10;
if(--dig==dec) putch(',');
}
putch((d % 10)+0x30);
}
Friendly Regards
Octavio Nogueira
===================================================
spam_OUTnogueiraTakeThisOuT
propic2.com ICQ# 19841898
ProPic tools - low cost PIC programmer and emulator
http://www.propic2.com
===================================================
{Original Message removed}
More... (looser matching)
- Last day of these posts
- In 2000
, 2001 only
- Today
- New search...