Do you mean a hex string or an integer? And, Do you mean a string for output, or bcd? And is this for output to a display, or to a serial port, etc., or internal storage. Also, are you wanting a solution which is optimized for code space or execution speed? What language and processor? On Jan 17, 2018 1:18 PM, "Dwayne Reid" wrote: > Good day to all. > > I'm looking for an efficient method of converting a hex number to > decimal. I'm aware of and have used both Scott Dattalo's 8-bit to > Decimal routine as well as John Payson't 16-bit to Decimal routine > but I'm looking for something in-between those two. > > I'm starting off with a 12-bit number but eventually wind up with a > 9-bit result after scaling. Ideally, I'd like two optimized > routines: 9-bit to Decimal and 12-bit to Decimal. > > Any ideas? > > Many thanks! > > dwayne > > -- > Dwayne Reid > Trinity Electronics Systems Ltd Edmonton, AB, CANADA > 780-489-3199 voice 780-487-6397 fax 888-489-3199 Toll Free > www.trinity-electronics.com > Custom Electronics Design and Manufacturing > > -- > http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > --=20 http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .