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
This is a very fast and simple way who doesn't need complex solution.
let duration = String(format: "%.01f", 3.32323242) // result = 3.3