bug: Pool reserves displayed as raw integers instead of human-readable amounts #5

Closed
opened 2026-03-12 02:41:27 +00:00 by Brouie · 17 comments
Brouie commented 2026-03-12 02:41:27 +00:00 (Migrated from gitlab.com)

Pool Reserves shows 502498500503 / 497513922430 instead of formatted values like 502,498.50 / 497,513.92. Needs decimal formatting based on token decimals.

Pool Reserves shows 502498500503 / 497513922430 instead of formatted values like 502,498.50 / 497,513.92. Needs decimal formatting based on token decimals.
Brouie commented 2026-03-12 03:25:07 +00:00 (Migrated from gitlab.com)

mentioned in issue #1

mentioned in issue #1
PlasticDigits commented 2026-03-12 07:07:39 +00:00 (Migrated from gitlab.com)

Fix implemented — pool reserves now display as human-readable amounts with significant figures (e.g. 502.5K instead of 502498500503).

Changes:

  • New shared utility frontend-dapp/src/utils/formatAmount.ts with formatTokenAmount(rawAmount, decimals, sigfigs) that converts raw on-chain integers → human-readable using BigInt precision + K/M/B/T abbreviations with configurable sigfigs (default 4).
  • PoolPage.tsx and SwapPage.tsx pool reserves now formatted via formatTokenAmount with decimals resolved from the token registry.
  • Deduplicated the local formatNum copies in ChartsPage/TraderPage into the shared utility, and wired TiersPage's formatCl8y through it as well.

@Brouie — can you verify the pool reserves look correct on both the Pools page and the Swap page trade details panel? Leaving this open until confirmed.

Fix implemented — pool reserves now display as human-readable amounts with significant figures (e.g. `502.5K` instead of `502498500503`). **Changes:** - New shared utility `frontend-dapp/src/utils/formatAmount.ts` with `formatTokenAmount(rawAmount, decimals, sigfigs)` that converts raw on-chain integers → human-readable using BigInt precision + K/M/B/T abbreviations with configurable sigfigs (default 4). - **PoolPage.tsx** and **SwapPage.tsx** pool reserves now formatted via `formatTokenAmount` with decimals resolved from the token registry. - Deduplicated the local `formatNum` copies in ChartsPage/TraderPage into the shared utility, and wired TiersPage's `formatCl8y` through it as well. @Brouie — can you verify the pool reserves look correct on both the Pools page and the Swap page trade details panel? Leaving this open until confirmed.
Brouie (Migrated from gitlab.com) closed this issue 2026-03-13 03:01:32 +00:00
Brouie commented 2026-03-13 03:01:35 +00:00 (Migrated from gitlab.com)

Verified fixed — pool reserves now show formatted amounts (e.g. 101.0K / 99.01K) via new formatAmount.ts.

Verified fixed — pool reserves now show formatted amounts (e.g. 101.0K / 99.01K) via new formatAmount.ts.
Brouie commented 2026-03-13 04:22:44 +00:00 (Migrated from gitlab.com)

mentioned in issue #18

mentioned in issue #18
PlasticDigits commented 2026-05-13 06:42:38 +00:00 (Migrated from gitlab.com)

mentioned in issue #158

mentioned in issue #158
PlasticDigits commented 2026-05-26 14:21:38 +00:00 (Migrated from gitlab.com)

mentioned in issue #148

mentioned in issue #148
PlasticDigits commented 2026-05-27 04:49:26 +00:00 (Migrated from gitlab.com)

mentioned in issue #114

mentioned in issue #114
PlasticDigits commented 2026-05-29 13:02:30 +00:00 (Migrated from gitlab.com)

mentioned in issue #209

mentioned in issue #209
PlasticDigits commented 2026-05-30 06:11:52 +00:00 (Migrated from gitlab.com)

mentioned in issue #220

mentioned in issue #220
PlasticDigits commented 2026-06-05 05:42:28 +00:00 (Migrated from gitlab.com)

mentioned in issue #321

mentioned in issue #321
PlasticDigits commented 2026-08-08 11:17:16 +00:00 (Migrated from gitlab.com)

mentioned in issue #502

mentioned in issue #502
leonardocolucci commented 2026-08-16 14:30:17 +00:00 (Migrated from gitlab.com)

mentioned in issue #529

mentioned in issue #529
PlasticDigits commented 2026-08-25 06:08:50 +00:00 (Migrated from gitlab.com)

mentioned in issue #509

mentioned in issue #509
PlasticDigits commented 2026-08-25 06:08:50 +00:00 (Migrated from gitlab.com)

mentioned in issue #510

mentioned in issue #510
PlasticDigits commented 2026-08-25 06:08:51 +00:00 (Migrated from gitlab.com)

mentioned in issue #511

mentioned in issue #511
PlasticDigits commented 2026-08-25 06:08:52 +00:00 (Migrated from gitlab.com)

mentioned in issue #588

mentioned in issue #588
PlasticDigits commented 2026-08-25 06:08:59 +00:00 (Migrated from gitlab.com)

mentioned in issue #637

mentioned in issue #637
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
code/cl8y-dex-terraclassic#5
No description provided.