Right, I missed this part.
There’s a hack you can use to manage this, which is not the simplest one (or prettiest one), but does the job.
The sequence would be something as follows:
- You do your math
- Get the result, and format it as you need (2 signs after a decimal), after what it becomes a text
- You save that text in the db
- Next time you pull the value for the calculation, you first get it trough the above mentioned hack (Input converting any data type to any data typ) to convert it back to number and do the calculation, then repeat the steps 2-3.
Let me know if that helps.