CSV export shows raw cents instead of a formatted amount (#27) - #32
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
September 23, 2026 19:02
Contributor
Author
|
/factory revise Add a test where the amount has a trailing zero cent, e.g. 45.50, so we know the column is not truncated. |
Param-Harrison
marked this pull request as draft
September 23, 2026 19:04
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.
Closes #27
Summary
The CSV export's
amountcolumn printed raw integer cents (4500) instead of a decimal amount (45.00).exportCsvinsrc/csv.tsnow formats that column withformatCents, following the handling-money rule to format only at the output edge. The fix also applies to the CLIexportcommand and toGET /api/groups/:id/export.csv, because both callexportCsv.Acceptance criteria
bun test tests/csv.test.ts:exportCsv > formats the amount column as a decimal via formatCentsgives45.00,12.00,30.00bun test tests/csv.test.ts:exportCsv > keeps the header row and one line per expensesrc/csv.tsreverted tomain,bun test tests/csv.test.tsfails (received["1200","3000","4500"])bun test tests/cli.test.ts tests/routes.test.ts: both export tests fail when the fix is reverted and pass with it (17 pass, 0 fail across csv/cli/routes)make check:tsc --noEmitclean,bun test29 pass / 0 fail, all 9 skills validNon-goals respected
src/money/**changed.formatCentsis reused as-is.csvEscapeare unchanged. Only how the amount field is written changed.amountCentsis still integer cents) andpublic/index.htmlare untouched.src/routes/export.tsandsrc/cli.tsare untouched. The fix is only insrc/csv.ts.The test that bites
tests/csv.test.ts›exportCsv > formats the amount column as a decimal via formatCentsmain:git checkout main -- src/csv.ts, thenbun test tests/csv.test.tsgives 1 pass, 1 fail (received"1200","3000","4500", expected"12.00","30.00","45.00")bun test tests/csv.test.tsgives 2 pass, 0 failGate line
(
auditwas skipped.make auditis not part ofmake check.)Protected paths touched
noneReviewer findings addressed
none (the full evidence is in the factory verdict comment on #27)
Human checklist
🤖 Generated with Claude Code