📜  格式化小数位swift代码示例

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

代码示例1
let tip: Double = 15.2847320
let tipText: String = String(format: "%.2f", tip)
// %.2f for two decimal places