Below is how I would have previously truncated a float to two decimal places
NSLog(@\" %.02f %.02f %.02f\", r, g, b);
I checked the docs an
I found String.localizedStringWithFormat to work quite well:
String.localizedStringWithFormat
Example:
let value: Float = 0.33333 let unit: String = "mph" yourUILabel.text = String.localizedStringWithFormat("%.2f %@", value, unit)