I am doing some programming inside a TableView which is getting some Json data and one of the elements coming back is of type Float and I am having trouble using the text property on a float this is my code
var latitudes = [Float]()
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "mycelia", for: indexPath)
// This gives error can't convert type String to Float
cell.MyLabel.text = latitudes[indexPath.row]
return cell
}
I am new to Swift and have tried other methods such as what is explained here Convert String to float in Apple's Swift but can not get it to work