Answers for "format number of digits python"

0

format number of digits python

# credit to Stack Overflow user in source link
# x is a floating point number
# a is the total width of the field being printed, lefted-padded by spaces.
# b is the number of digits after the decimal point

print("{:a.bf}".format(x))
Posted by: Guest on June-03-2021

Code answers related to "format number of digits python"

Python Answers by Framework

Browse Popular Code Answers by Language