Updating Existing Object in Firebase with Swift 3
<p>I've been having trouble saving an object pulled in from Firebase.  I want to grab the value of 'cardAmount', add to it and save it.  But it keeps giving me trouble about it not being ale to convert a number to a string.  I think I might be hung up on modifying the data structure wrong, but I've been stuck on this for a little while - can anyone give me some guidance on how to edit a single Child Snapshot in Firebase as I need it?</p>

<pre><code>let sevenDayOption = UIAlertAction(title: "Seven Day: $31", style: .default, handler: {
        (alert: UIAlertAction!) -&gt; Void in
        let query = ref.queryOrdered(byChild: (FIRAuth.auth()!.currentUser?.uid)!)
        query.observeSingleEvent(of: .value, with: { (snapshot) in
            let cardAmount = snapshot.childSnapshot(forPath: "cardAmount").value as! Float
            let newAmount = cardAmount + 31
            let newAmountString = String(format:"%.2f", newAmount)
            snapshot.setValue(newAmountString, forKeyPath: snapshot.childSnapshot(forPath: "cardAmount").value as! String)
            print(snapshot.childSnapshot(forPath: "cardAmount").value as! Float) /*&lt;---- Prints Optional(30.5)*/

        })
    })
</code></pre>

<p>I'm sure it's probably something simple, but it's also something that eludes me at the moment.  Relatively new to Firebase and Swift so its been a bit of a challenge wrestling with it at times.</p>

<p>Thanks!</p>