📜  我如何从浮点数快速获取字符串到十进制数快速代码示例

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

代码示例1
let someFloat: Float = 3.14159
let floatToString: String = String(format: "%.01f", someFloat)
// floatToString => 3.14