Use a format string with your number to manipulate how many decimal places to show:
var x:Float = 66 / 130
var y:Double = 66 / 130
print(String(format: "%.2f, %.2f", x, y))
Result:
0.51, 0.51
Other useful variations:
var x = 66 / 130 // 0.5076923076923077
var y = Double(round(1000 * x) / 1000) // 3 digits precision
print(y) // 0.508
print(floor(100 * y) / 100) // 0.5
print(ceil(100 * y) / 100) // 0.51
print(String(format: "%.2f", y)) // 0.51
print(String(format: "%.2f", floor(100 * y) / 100)) // 0.50
print(String(format: "%.2f", ceil(100 * y) / 100)) // 0.51
Using 3 digits precision then reducing to two digits allows you to control the floor and ceiling while at the same time having the desired amount of digits displayed after the decimal point.
Dropping the leading zero before the decimal point:
var t = String(format: "%.2f", ceil(100 * y) / 100)
print(String(t.characters.dropFirst())) // .51