Check out example codes for "how do i get a string from a float swift to 1 decimal swift". It will help you in understanding the concepts better.

Code Example 1

let someFloat: Float = 3.14159
let floatToString: String = String(format: "%.01f", someFloat)
// floatToString => 3.14

Learn ReactJs, React Native from akashmittal.com