format number of digits python

Solutions on MaxInterview for format number of digits python by the best coders in the world

showing results for - "format number of digits python"
Allison
04 Jul 2017
1# credit to Stack Overflow user in source link
2# x is a floating point number
3# a is the total width of the field being printed, lefted-padded by spaces.
4# b is the number of digits after the decimal point
5
6print("{:a.bf}".format(x))