目录
1. 标准格式化语法
如下字符串的标准格式化规范语法,可直接在字符串的 format() 方法上使用,也可以用于 Python3.6 新添加的 f-字符串。
format_spec ::= [[fill]align][sign][#][0][width][grouping_option][.precision][type]
fill ::= <any character>
align ::= "<" | ">" | "=" | "^"
sign ::= "+" | "-" | " "
width ::= digit+
grouping_option ::= "_" | ","
precision ::= digit+
type ::= "b" | "c" | "d" | "e" | "E" | "f" | "F" | &#