I am trying to get some percentages to print to 4 decimal places. My code looks like this
for i in range(len(candidates)): #looping through the results
percentage_votes = "{:.4%}".format(results[i][1] / voters) #setting the number to a %
print(f'{results[i][0]}: {percentage_votes} ({results[i][1]})') #print result
When it prints; however, rather than giving me the decimal places of the division, it instead returns all zeros in the 4 decimal places.
Khan: 63.0000% (2218231)
Correy: 20.0000% (704200)
Li: 14.0000% (492940)
O'Tooley: 3.0000% (105630)
What do I need to correct in my code to give me the further divided number? Thanks!