Skip to content

fix: preserve zero-decimal currency precision in amount conversion - #1568

Open
Zenoxy97 wants to merge 1 commit into
worknenjoy:masterfrom
Zenoxy97:codex/fix-zero-decimal-currencies
Open

Zenoxy97 wants to merge 1 commit into
worknenjoy:masterfrom
Zenoxy97:codex/fix-zero-decimal-currencies

Conversation

@Zenoxy97

@Zenoxy97 Zenoxy97 commented Sep 9, 2026 •

Copy link
Copy Markdown

The amount conversion helper replaces a valid zero decimal precision with the two-decimal fallback. For 1,000 JPY with an 8% fee, converting a decimal amount to minor units returns 92,000 instead of 920. The inverse conversion displays 9.2 instead of 920. The seller-net calculation also receives the incorrect minor-unit amount.

This changes decimalPlaces || 2 to decimalPlaces ?? 2, preserving zero precision while retaining the fallback for unknown currencies. Regression tests cover zero-decimal currencies in both directions, uppercase JPY, the unknown-currency fallback, and the seller-net calculation. Existing two- and three-decimal tests remain green.

Validation on the current master base:

  • Targeted amount-conversion and seller-net suites: 36 passing.
  • TypeScript: npm run typecheck passes.
  • Full CircleCI pipeline: build, database migrations/seeds, backend tests, and frontend tests passed on commit 3866061 (run #4987).
  • No real payments were exercised; this does not establish that production transactions were affected.

This contribution was prepared with OpenAI Codex assistance and independently reviewed by a second coding agent.

Would you consider a USD 25 bounty for accepting and merging this fix? No bounty was previously agreed; this is an optional request. Payment details can be shared privately after agreement.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 9, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-09T14:53:39.961839Z 3866061 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@alexanmtz

Copy link
Copy Markdown
Member

Thanks for the fix. To be upfront: we don't have budget for bounties right now, so there's no bounty funded for this PR and I can't confirm the $25 ask. Once we do have budget, we'll add funded issues on the platform, and/or set up a program to pay out for useful PRs like this one — so it's worth checking back.

Gitpay is the platform we use to fund and pay out bounties — it's what gives contributors an actual guarantee of payment, since funds are held and released through the platform rather than promised informally. We don't arrange payment outside it.

That said, we're still happy to review this PR on its own merits if you'd like us to — no payment obligation either way. If you'd only like it merged in exchange for payment, totally understandable, and you're welcome to close it instead; no hard feelings.

If you want to be set up for bounty-funded work here or elsewhere on the platform, create/activate an account at gitpay.me. Gitpay is open source and a community project — you're very welcome to join and try it out.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants