Fee discount tiers page: inconsistent number formatting #46

Closed
opened 2026-03-27 10:31:07 +00:00 by PlasticDigits · 5 comments
PlasticDigits commented 2026-03-27 10:31:07 +00:00 (Migrated from gitlab.com)

Summary

On the fee discount tiers page, threshold amounts are formatted in a way that is hard to read: decimal precision is inconsistent (e.g. three decimal places in some places, one in others), which makes the tiers confusing at a glance.

Expected / desired behavior

Standardize how tier thresholds are displayed so users can scan them quickly.

Ideas discussed (not mutually exclusive):

  • Option A — decimals: Use a single rule everywhere for the lower end — either one decimal place or none — while keeping larger round values (e.g. 10k-style) acceptable if that stays clear.
  • Option B — full numbers: Prefer no fractional decimals and no k shorthand — show full values with grouping instead (e.g. 1,500 rather than abbreviated forms).

Scope

Frontend: fee discount tiers UI (number formatting only; behavior of tiers unchanged unless a bug is found during the pass).

## Summary On the **fee discount tiers** page, threshold amounts are formatted in a way that is hard to read: decimal precision is inconsistent (e.g. three decimal places in some places, one in others), which makes the tiers confusing at a glance. ## Expected / desired behavior Standardize how tier thresholds are displayed so users can scan them quickly. **Ideas discussed (not mutually exclusive):** - **Option A — decimals:** Use a single rule everywhere for the lower end — either **one decimal place** or **none** — while keeping larger round values (e.g. **10k**-style) acceptable if that stays clear. - **Option B — full numbers:** Prefer **no** fractional decimals and **no** `k` shorthand — show full values with grouping instead (e.g. **1,500** rather than abbreviated forms). ## Scope Frontend: fee discount tiers UI (number formatting only; behavior of tiers unchanged unless a bug is found during the pass).
PlasticDigits commented 2026-03-28 09:39:37 +00:00 (Migrated from gitlab.com)

mentioned in commit da14eae59f

mentioned in commit da14eae59fa54de2a68ee4d8e8ffb1333727f52f
PlasticDigits commented 2026-03-28 09:39:47 +00:00 (Migrated from gitlab.com)

Implementation (fee tier number formatting)

Problem: Tier CL8Y thresholds used formatTokenAmount → significant figures + K/M/T abbreviations, so values mixed styles (e.g. extra decimal places vs shorthand).

Change: Added formatTokenAmountGrouped() in frontend-dapp/src/utils/formatAmount.ts: full amounts with en-US thousands grouping, no K/M shorthand, no decimal point for whole-token thresholds (exact conversion via fromRawAmount). TiersPage formatCl8y now uses this for tier rows and the "How it works" table.

Tests: Unit tests in formatAmount.test.ts; npm run build and Vitest pass locally.

Commit: da14eae on main.

Leaving this issue open for QA.

/cc @brouie Please verify on Fee Tiers (/tiers): thresholds read as full grouped numbers (e.g. 3,500, 7,500) and stay consistent between the tier list and the summary table.

## Implementation (fee tier number formatting) **Problem:** Tier CL8Y thresholds used `formatTokenAmount` → significant figures + K/M/T abbreviations, so values mixed styles (e.g. extra decimal places vs shorthand). **Change:** Added `formatTokenAmountGrouped()` in `frontend-dapp/src/utils/formatAmount.ts`: full amounts with en-US thousands grouping, no K/M shorthand, no decimal point for whole-token thresholds (exact conversion via `fromRawAmount`). `TiersPage` `formatCl8y` now uses this for tier rows and the "How it works" table. **Tests:** Unit tests in `formatAmount.test.ts`; `npm run build` and Vitest pass locally. **Commit:** `da14eae` on `main`. Leaving this issue **open** for QA. /cc @brouie Please verify on **Fee Tiers** (`/tiers`): thresholds read as full grouped numbers (e.g. `3,500`, `7,500`) and stay consistent between the tier list and the summary table.
PlasticDigits commented 2026-03-28 09:45:32 +00:00 (Migrated from gitlab.com)

Follow-up: tiers keep K/M/B/T again; only change is dropping meaningless decimals on whole token thresholds (e.g. 1, 5K not 1.000 / 5.000K). 21b9af4.

Follow-up: tiers keep **K/M/B/T** again; only change is dropping meaningless decimals on **whole** token thresholds (e.g. `1`, `5K` not `1.000` / `5.000K`). `21b9af4`.
PlasticDigits commented 2026-03-28 09:45:37 +00:00 (Migrated from gitlab.com)

mentioned in commit 21b9af4b87

mentioned in commit 21b9af4b87161bb4d6df26a4030b4a0862e38696
Brouie commented 2026-03-30 04:44:34 +00:00 (Migrated from gitlab.com)

Verified fixed on 2a09e75. Number formatting consistent across Fee Discount Tiers page — K abbreviation for large numbers, consistent decimal places, no scientific notation. Table matches cards.

Verified fixed on 2a09e75. Number formatting consistent across Fee Discount Tiers page — K abbreviation for large numbers, consistent decimal places, no scientific notation. Table matches cards.
Brouie (Migrated from gitlab.com) closed this issue 2026-03-30 04:45:32 +00:00
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#46
No description provided.