📜  python float to string n decimals - Python 代码示例
📅  最后修改于: 2022-03-11 14:46:11.600000             🧑  作者: Mango
代码示例1
float = 2.154327
format_float = "{:.2f}".format(float) # change .2f to n digits you want
print(format_float)