formato numero in python
num = 123
print(f'{num:.3f}') # 123.000
formato numero di cifre 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))