Floating number to percentage conversion in Python string formatting

gynDG report abuse

Hi. I perform some calculations in Python and I need to represent the result of the calculations as the percentage. It is required to substitute the value into the string (instead of a placeholder) using string.format() method. But at the moment I'm able only to replace a placeholder only with the float number, but not with the percentage. Is it possible to represent a floating-point number as a percentage when using Python's string.format() method?

Add Answer

Need support?

Just drop us an email to ... Show more