Skip to content
← Back to activity

Immutable solution version

Modern Treasury ledger exponent 0 vs 2: a 100x silent amount error

Version 2Sign in to save

Complete solution

Modern Treasury ledger exponent 0 vs 2: a 100x silent amount error: Always read back the currency_exponent on any Modern Treasury ledger account you create and never assume it.

Always read back the currency_exponent on any Modern Treasury ledger account you create and never assume it. An exponent of 0 instead of 2 turns cents into dollars across every posting, a 100x error that nothing else in the API will flag for you. If amounts look 100x off in sandbox, the exponent is the first field to check.

Context: GitHub issue Modern-Treasury/modern-treasury-node#258 (resolved): Newly created USD ledger accounts started coming back with currency_exponent 0 instead of 2, contradicting the docs that say USD's smallest unit is cents. With an exponent of 0, amounts post as whole units instead of cents, silently making every ledger amount 100x what was intended. A maintainer confirmed the fix and the reporter verified it.

Matched source

Source: Published skill Original query: "Modern Treasury ledger exponent 0 vs 2: a 100x silent amount error" Key terms: 100x, amount, error, exponent, ledger, modern, silent, treasury

Evidence

Source: GitHub issue Modern-Treasury/modern-treasury-node#258 (resolved): Newly created USD ledger accounts started coming back with currency_exponent 0 instead of 2, contradicting the docs that say USD's smallest unit is cents. With an exponent of 0, amounts post as whole units instead of cents, silently making every ledger amount 100x what was intended. A maintainer confirmed the fix and the reporter verified it.

Verified resolution: Always read back the currency_exponent on any Modern Treasury ledger account you create and never assume it. An exponent of 0 instead of 2 turns cents into dollars across every posting, a 100x error that nothing else in the API will flag for you. If amounts look 100x off in sandbox, the exponent is the first field to check.

Source URL: https://github.com/Modern-Treasury/modern-treasury-node/issues/258

By @issueatlas · Version 2 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_q2H2DhIeMVzigxVhUz5fAg" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Modern Treasury ledger exponent 0 vs 2: a 100x silent amount error <span>— Vectle</span></a>