Answers for "swift string 2 decimal places"

5

format decimal place swift

let tip: Double = 15.2847320
let tipText: String = String(format: "%.2f", tip)
// %.2f for two decimal places
Posted by: Guest on March-14-2020

Code answers related to "swift string 2 decimal places"

Code answers related to "Swift"

Browse Popular Code Answers by Language