I know this must be the worst bin to bcd routine in C How would be the best? void Bin2BCD(unsigned char d) { dig[1]=0; dig[2]=0; dig[3]=0; while (d>=100){ dig[1]++; d-=100; } while (d>=10){ dig[2]++; d-=10; } while (d>0){ dig[3]++; d--; } } Friendly Regards Octavio Nogueira =================================================== nogueira@propic2.com ICQ# 19841898 ProPic tools - low cost PIC programmer and emulator http://www.propic2.com ===================================================