Assuming a 5Vref and say 2.5Vinput
V = 5 * [512/1023] = 5 * 0.5 = 2.5V
So do the 512/1023 part first, as you need to avoid decimals, multiply the 512 by say 100.
This gives 51200/1023, which can be done with unsigned integer math subr, yields 50 as a integer result.
Now multiply this result by 5 [Vref] to give 250
When you display the result, insert a decimal point between the 2 and 5, so you display 2.50V.
If you require a higher resolution, multiply the 512 by 1000.
OK.?