Answers for "print number upto 2 decimal places in f string python"

0

print number upto 2 decimal places in f string python

variable = 77.05750066143399
# Print variable upto 2 decimal places using f-string
print(f"Variable upto 2 decimal places : {variable:.2f}")
################# Output #################
Variable upto 2 decimal places : 77.06
##########################################

# don't forget to upvote :)
Posted by: Guest on April-28-2022

Code answers related to "print number upto 2 decimal places in f string python"

Python Answers by Framework

Browse Popular Code Answers by Language