Repository navigation
CSV export shows raw cents instead of a formatted amount (#186) - #187
Closed
Param-Harrison wants to merge 3 commits into
Closed
Param-Harrison wants to merge 3 commits into
Param-Harrison wants to merge 3 commits into
Conversation
Param-Harrison
marked this pull request as ready for review
October 13, 2026 13:33
Contributor
Author
|
/factory revise add a test for an amount under one dollar, like 5 cents |
Param-Harrison
marked this pull request as draft
October 13, 2026 13:47
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.
Summary
exportCsv(shared by the CSV route andsplitbill export) now prints the amount column as a 2-decimal string viaformatCentsinstead of raw integer cents, so1000reads10.00.Closes #186
Plan
Plan comment (rev 1):
formatCents(4500 ->45.00), verified bybun test tests/csv.test.ts("exportCsv formats the amount column as a decimal")10.05, 1050 ->10.50), verified by "exportCsv keeps two decimal places"tests/routes.test.tsandtests/cli.test.tsexport testsmake checkLeft out (non-goals): no change to
src/money/**, the CSV header/column order/csvEscape, the DB schema or SQL,src/routes/**,src/cli.ts, or any protected path.Files changed:
src/csv.ts(useformatCents, drop the stale "SEEDED DEFECT" comment) and the newtests/csv.test.ts.Gate evidence
FACTORY_GATES: status=GREEN passed=3 failed=0 skipped=1 failed_gates=audit(The audit gate is optional and was skipped, not failed.)
Verify verdict
Verdict: pass, all of AC-1 to AC-4. See the verdict comment on the issue #186 thread. Test that bites: with
src/csv.tsreverted, all 3 new tests fail on the amount value (e.g."1005"received where"10.05"was expected); with the fix they pass (17 pass, 0 fail across the csv, routes and cli tests).Reviewer notes, not addressed here:
csvEscapedoes not neutralise a leading=,+,-or@, so the export is open to spreadsheet formula injection. NG-2 forbids changing it here, so it needs its own issue.Risk and rollback
Low: a change confined to one non-protected module with no schema or API-shape change. Rollback: revert this PR; nothing stored changes, since only how the amount is rendered in the export differs.
Factory run
Proof: the new test fails without the change.
5 stage runs, 3m 23s, $1.08.
Went well
Needed help