[Swift] 소수점 없애기
2023. 1. 1. 21:31
let deleteDot = basePrice.components(separatedBy: [","]).joined()
let calculateValue:Double = Double(deleteDot)!
let result: Double = Double(money)! / calculateValue
moneytextField2.text! = String(format: "%.2f", result)
728x90
'iOS > Swift' 카테고리의 다른 글
[Swift] for문 (0) | 2023.02.07 |
---|---|
[Swift] UnsafePointer, UnsafeMutablePointer (0) | 2023.01.08 |
[Swift] 클로저 (0) | 2022.12.24 |
[Swift] 다른 앱 실행시키기 (0) | 2022.12.04 |
[Swift] URLComponent (0) | 2022.11.20 |