First Method:- Using Float precision More clear than the below solution which just returns 0. Take This One. When you use this initializer, Swift will automatically round the final digit as needed based on the following number. Special cases: x.roundToInt() == Int.MAX_VALUE when x > Int.MAX_VALUE; x.roundToInt() == Int.MIN_VALUE when x < Int.MIN_VALUE; Exceptions Swift's Float data type has a built-in constructor that can convert from integers with no extra work from you. Enabling a platform with one a kind … extension String { var floatValue: Float { return (self as NSString).floatValue } } Now you can just call var WageConversion = Wage.text.floatValue and allow the extension to handle the bridge for you! To round a value using the default “schoolbook rounding”, you can use the shorter rounded () method instead. If you would need that many decimals, you might then want to choose the Decimal type instead.. For example, to convert the integerÂ