fix(budget-tracker): use Decimal for precision, add edit & delete-by-…#1719
Closed
Rachi-collab wants to merge 1 commit into
Closed
fix(budget-tracker): use Decimal for precision, add edit & delete-by-…#1719Rachi-collab wants to merge 1 commit into
Rachi-collab wants to merge 1 commit into
Conversation
|
@Rachi-collab is attempting to deploy a commit to the Anuj's projects Team on Vercel. A member of the Team first needs to authorize it. |
Owner
|
@Rachi-collab not your assigned issue |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
floatusage withdecimal.Decimalfor monetary values to eliminate floating-point precision errors (e.g.0.1 + 0.2no longer gives0.30000000000000004)edit_transaction()— lets users update category, description, amount, or type of any existing entry by ID without touching other recordsdelete_transaction()— lets users remove a single transaction by ID after confirmationidcolumn to the CSV schema; existing files without it are auto-migrated on startupWhy
Fixes all three issues reported in #1718:
floatarithmeticHow
DecimalwithROUND_HALF_UPto 2 decimal places is used everywhere amounts are read, stored, or calculatedsave_all_transactions()rewrites the full CSV atomically, used by both edit and deletenext_id()generates auto-incrementing integer IDs;initialize_file()detects and backfills IDs in old CSV files for backward compatibilityTesting
python -m py_compileto verify no syntax errorsidcolumn) and confirmed IDs were backfilled correctlyCloses #1718