Save and Read Integer Firestore Android

After doing some tests I got to the conclussion we're gonna have to cast Longs to Integers, since that's what we get from fetching a "Number" from firestore. Here's what my data looks like:

Make sure you stored a "Number" by clicking on the "edit" icon at the end of the field:

Use this to do the casting: Safely casting long to int in Java

My code looks like this:

int money = snapshot.getLong("money").intValue();

Feel free to ask for further explanation!