I'm trying to save and retrieve a float datatype into Firebase. I am able to save just fine and have it structured like below.
However, when I attempt to retrieve the value using the code
for child in snapshot.children.allObjects as! [FDataSnapshot] {
let rating = child.value["rating"] as? Float
print(rating)
I'm getting the following:
Optional(8.19999981)
Optional(8.69999981)
Optional(9.19999981)
What is the best way to prevent this from occurring?