📜  使用 format() 格式化数字 - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:57.294000             🧑  作者: Mango

代码示例1
# d, f, b and h are types

# integer
print(format(12, "d"))

# float arguments
print(format(123.4567898, "f"))

# binary format
print(format(12, "b"))

# hexadecimal format
print(format(12, "x"))