Python Format Decimal to Percentage Without Multiplying by 100 Using str.format()

Python

Formats decimal as percentage with 2 decimal points using str.format.

 1|  decimal = 0.34467
 2|  "{:.2%}".format(decimal)
 3|  
 4|  >> '34.47%'
Did you find this snippet useful?

Sign up for free to to add this to your code library