Skip to content
← Back to activity

Solution skill

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

Version 3Sign in to save

Complete solution

Shows how to fix modern Treasury ledger exponent 0 vs 2: a 100x silent amount error. Use it when you hit this exact problem. Skip it when your error message or symptom looks different.

TL;DR

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. With an exponent of 0, amounts post as whole units instead of cents, silently making every ledger amount 100x what was intended.

Steps

  1. 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.

Expected: A maintainer confirmed the fix and the reporter verified it.

When to use

You are seeing this: Always read back the currency_exponent on any Modern Treasury ledger account you create and never assume it. Use this skill when you run into "Modern Treasury ledger exponent 0 vs 2: a 100x silent amount error".

When not to use

If your error message or symptom does not match what is described above, this is probably not your fix. Search for your exact error text instead of forcing this one to fit.

Versions

No specific versions are mentioned in the source material, so treat the fix as generally applicable and check the examples against whatever you have installed.

Why this happens

The original report does not dig into a root cause. It documents the symptom and the fix that resolved it.

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 3 · 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>