Printing float up to six decimal places
42,889
This can be accomplished by:
print("{:.6f}".format(your value here));
Author by
Rohith
Updated on July 12, 2022Comments
-
Rohith almost 2 years
I have an issue in printing a float number. I tried:
a = 2 c = 4 print (str(c/a).format(1.6))
Output:
2.0
Required Output:
2.000000
How can I print up to 6 decimal places?