For 8-bit results, the largest number will be 255 at +5V.
255 * 2 = 510
510 / 100 = 5 (integer)
So let's assume you were trying to convert the A/D reading to a Voltage number.
<pre>255 * 5 / 255 = 5 ; Single digit<br>255 * 50 / 255 = 50 ; 1 decimal place (5.0)<br>255 * 500 / 255 = 500 ; 2 decimals (5.00)</pre>Those could also be done with the */ (Mid word) multiplication.<pre>255 */ 5 = 5<br>255 */ 50 = 50<br>255 */ 500 = 500</pre>Be sure to use WORD variables for the calculation.
Then to display it ...<pre>LCDOUT DEC value,"V" ; Single digit<br>LCDOUT DEC value/10,".",DEC value // 10, "V" ; 1 decimal place<br>LCDOUT DEC value/100,".",DEC value // 100, "V" ; 2 decimals</pre>
If you go with 2 decimals, you may want to use 10-bit values from the A/D for better accuracy.
In which case you would Right Justify, and the math changes to...<pre>1023 * 5 / 1023 = 5 ; Single digit<br>1023 * 50 / 1023 = 50 ; 1 decimal place<br>1023 * 500 / 1023 = 500 ; 2 decimals</pre>But you'll need to use DIV32 for those.
Bookmarks