You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some users are reporting that when they try to update an expense record, they get an error message: "The expense record you're trying to update doesn't exist"
The text was updated successfully, but these errors were encountered:
Root cause of this is because all of the monetary value columns use data type 'REAL' which is imprecise. According to Postgres docs, 'NUMERIC' data type is the solution to this problem:
The data types real and double precision are inexact, variable-precision numeric types. Inexact means that some values cannot be converted exactly to the internal format and are stored as approximations, so that storing and retrieving a value might show slight discrepancies. If you require exact storage and calculations (such as for monetary amounts), use the numeric type instead.
Tables | Columns that need to be updated from real to numeric(8,2):
users | income
expenses | amount
budgets | amount
Front-end changes that need regex to be updated to prevent more than 8 digits, 2 precision:
dashboard
addexpense
createbudget
updatebudget
Back-end can be improved to also check for numeric constraints, otherwise user will face 'Internal Error' message if for some reason they are able to enter a numeric with more than 8 digits or 2 precision
Some users are reporting that when they try to update an expense record, they get an error message: "The expense record you're trying to update doesn't exist"
The text was updated successfully, but these errors were encountered: