You wrote... >...For a Left-justified >return the result would be 0..16368. No, it'll be 0...65472. >...The alternative would be >to add a more-or-less complete set of math routines to the code, and at this >time I don't see the need for that. If you want to scale the input to the A/D with a voltage divider so that the full-scale A/D result corresponds to 16.384 volts, you hardly need a complete set of math routines: if you operate the A/D so that its result is left-justified, just shift the result right two bits (with zero fill) before converting it to BCD; if you operate the A/D right-justified, shift the result left four bits instead. BTW, as Ken Pergola suggested, the default radix in the code I posted was DEC. Sorry for not specifying that. Dave D. -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details.