Repository navigation
CSV export shows raw cents instead of a formatted amount (#170) - #176
Closed
Param-Harrison wants to merge 2 commits into
Closed
Param-Harrison wants to merge 2 commits into
Param-Harrison wants to merge 2 commits into
Conversation
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
The CSV export (and the CLI
exportcommand that shares it) now prints the amount column as a formatted decimal (10.00) viaformatCents, instead of raw integer cents (1000).Closes #170
Plan
Plan comment (rev 1):
exportCsvwritesformatCents(amountCents)(1000 →10.00, 1005 →10.05), verified bybun test tests/csv.test.ts("formats the amount column as a 2-decimal amount").45.00,12.00,30.00, verified bybun test tests/csv.test.ts("seeded flat-4b export uses formatted amounts").make test.make check.Deliberately left out (non-goals): no change to
src/money/**(including the separatesplitCentsremainder bug), the CSV header/columns/csvEscape, routes, CLI, auth, schema or stored data. No float math on money.Gate evidence
FACTORY_GATES: status=GREEN passed=3 failed=0 skipped=1 failed_gates=audit(
auditis skipped; it is not part ofmake check.)Verify verdict
Verdict: pass, all four ACs. The verdict comment is on the issue thread (#170) and is not copied here.
Test that bites: with
src/csv.tsreverted, "formats the amount column as a 2-decimal amount" fails withExpected ["10.00","10.05"],Received ["1000","1005"]. The seeded-export test fails the same way (["4500","1200","3000"]).Noted by the reviewer as separate pre-existing issues, not part of this PR:
csvEscapedoes not neutralise formula-leading characters, andformatCentsthrows on a non-integeramountCents.Risk and rollback
Low: a change confined to one non-protected module (
src/csv.ts) plus a new test file, with no schema or API-shape change. Only the text of the amount values changes. Rollback: revert this PR; stored data is untouched.Factory run
Proof: the new test fails without the change.
5 stage runs, 2m 56s, $1.09.
Went well
Needed help