I am new to python and am having some difficulties. How would I make this so that I can round the float(roll)*100 rounded to 2 decimal places.
for x in roll1:
print('%d - %d %f%%' %(x,roll1[x], float(roll1[x])/float(roll)*100))
This is the output currently. I need to make the numbers rounded to 2 decimal places. Thanks!
1 - 1794 17.940000%
2 - 1620 16.200000%
3 - 1620 16.200000%
4 - 1611 16.110000%
5 - 1650 16.500000%
6 - 1705 17.050000%