Repository navigation
Closed
Labels
bugSomething isn't working
Description
🤖 Tracks the upstream fix we'll propose for actualbudget#8858 ("KRW/JPY amounts inflated 100×"). The work is on branch 8858-store-every-currency-at-two-decimals in a local upstream checkout; nothing is pushed or opened upstream yet.
Problem
- With the experimental
currencyfeature and a currency without decimals (JPY, KRW, IRR), upstream mixes two scales:- ×100: the transaction register, mobile entry, imports, bank sync, rule formulas, CSV export and the API.
- ×1: the shared formatting hook
useFormatand everything built on it (balances, totals, budget cells, reports, schedules, rules, filters, reconcile), plus the budget templates and the goal editors.
- With JPY as the default, two ¥1,500 payments are stored as -150000 each, but the balance shows -¥300,000. Switching the default between USD and JPY multiplies or divides every balance by 100.
- Maintainer youngcw on KRW/JPY amounts inflated 100× and register shows phantom decimals — decimalPlaces:0 not honoured outside balance views actualbudget/actual#8858: "All numbers are stored in the db as integers, aka *100. That is expected."
Resolved by the fix
- One rule: every amount is stored ×100, whatever the currency. A currency's decimals only decide how many digits are shown. The rule is named
STORED_DECIMAL_PLACESinshared/util.ts. - Balances and inputs:
useFormatnow displays and reads amounts at ×100. This covers balances, totals, budget cells, hold/transfer/cover, rules, schedules, filters, reconcile and reports. JPY balances show -¥3,000 instead of -¥300,000, and a ¥1,500 typed into a budget cell is stored as 150000. - Typed digits: the desktop amount input (
AmountInput) and the mobile one (FocusableAmountInput) take typed digits as whole units for currencies without decimals. - Templates and goals: the goal editors, the server budget templates (
category-template-context.ts,schedule-template.ts), formula cards and budget movement notes use the ×100 scale. The template code no longer reads the currency at all, so that plumbing was removed. - Helpers: removed
amountToCurrencyInteger, which had no callers and encoded the opposite rule.integerToCurrencyWithDecimal(…, code)divides by 100 and shows the currency's digits. - Docs: the API docs say amounts are always
value * 100; a Bugfix release note is added. - Tests:
- new
useFormattests (USD, JPY, and JPY with decimals hidden); - JPY template tests updated to ×100;
- a JPY movement-notes test;
- updated
utiltests.
- new
Not changed, on purpose
- No data migration. Amounts typed into budget cells, goals or rules in a 0-decimal currency before the fix need to be re-entered (said in the release note).
- Fractions are kept as typed; only the display rounds.
- Untouched: the sync-server and the paths that already use ×100.
- Register rows still show two decimals for JPY unless "hide decimals" is on. Picking JPY in Settings turns it on, so this is a possible follow-up only.
Verification
- Format, lint and typecheck pass.
- Focused tests: 262 (core) and 27 (web).
- Full suites: web 1,386 passed. Core 1,341 passed; the only 2 failures are the known Windows EBUSY ones in
main.test.ts. - In the app, with JPY as the default:
- the balance shows -¥3,000 (was -¥300,000);
- a budget cell typed as 1500 is stored as 150000 and shown as ¥1,500.
Related
- Upstream: KRW/JPY amounts inflated 100× and register shows phantom decimals — decimalPlaces:0 not honoured outside balance views actualbudget/actual#8858 (closed as not planned; this fix follows its rule), and the currency feedback thread [Feedback] Currency symbol support actualbudget/actual#5191.
- Blocks part of 🤖 Add multi-currency support #1: once this fix is in (or at the base of the branch), the multi-currency branch can stop limiting accounts and the default currency to two decimal places.
Next
- Open the upstream PR citing KRW/JPY amounts inflated 100× and register shows phantom decimals — decimalPlaces:0 not honoured outside balance views actualbudget/actual#8858; @rapastranac fills in its template.
- Then put the fix at the base of the 🤖 Add multi-currency support #1 branch and lift the two-decimal restriction.
AI disclosure: drafted with Claude Code for @rapastranac.
Metadata
Metadata
Assignees
Labels
bugSomething isn't working
Activity
rapastranac commentedon Oct 27, 2026
This has been merged to master