I spent some time figuring out how the Roune with x decimals function works.
I finally was able to understand it and it will save me a lot of trouble in the future.
Here are my thoughts, please someone correct if I am wrong.
I am talking about this function:
I thought this was merely a ROUND function, but as a matter of fact this converts the numbers to a TEXT format.
Usually this is no problem because it can easily be used in another math function and it will be treated as a number.
The problem for me was when Getting this information from Firebase and trying to “Round to 2 decimals” again… then it crashed.
Solution was to keep the “Round to 2 decimals” function only for displays of labels and while uploading to Firebase adding a (variable + 0) function to make sure it is stored as a number in Firebase.
I think the “hint” on the function should be explained better.