📜  swift代码示例中的printf

📅  最后修改于: 2022-03-11 15:01:01.059000             🧑  作者: Mango

代码示例1
let x = 3.1415926
print(String(format: "%.2f", x)) //3.14

print(String(format: "%2.2f", x)) //  3.14 (two blank spaces in front of 3.