更新时间:2023-02-21 16:30:56
格式化到小数点后6位:
Format it to 6 decimal places:
format(value, '.6f')
演示:
>>> format(2.0, '.6f')
'2.000000'
format()
函数按照给定的格式化说明将值转换为字符串.
The format()
function turns values to strings following the formatting instructions given.