Exactly, something pseudo like: res[0]=3D'0'; res[1]=3D'0'; res[2]=3D'0'; res[3]=3D'0'; while (i>=3D1000) { res[0]++; i-=3D1000;} while (i>=3D100) { res[1]++; i-=3D100; } while (i>=3D10) { res[2]++; i-=3D10; } res[3]+=3Di; /frax ----- Original Message -----=20 From: "Olin Lathrop" To: Sent: Monday, December 02, 2002 2:11 PM Subject: Re: [PIC]: 10 bit binary value to 4 char BCD. > > Does anyone have a routine for 10 bits ? > > > > ("000"-"3FF" -> 0, 0, 0, 0 - 1, 0, 2, 3) >=20 > In the relatively rare cases where I had to have the PIC itself = convert to > decimal, I've just done successive divides by 10. >=20 >=20 > ***************************************************************** > Embed Inc, embedded system specialists in Littleton Massachusetts > (978) 742-9014, http://www.embedinc.com >=20 > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu >=20 >=20 > -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu