Skip to content

Conversation

fhqvst
Copy link
Contributor

@fhqvst fhqvst commented Oct 15, 2025

Summary

In this PR we make use of the feed's exponent in all places where we display its price or confidence intervals.

Rationale

While slightly less visually pleasing, this change should prevent users from seeing any inconsistencies as a result of rounding.

How has this been tested?

  • Current tests cover my changes
  • Added new tests
  • Manually tested the code

Copy link

linear bot commented Oct 15, 2025

Copy link

vercel bot commented Oct 15, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
component-library Ready Ready Preview Comment Oct 17, 2025 9:49am
insights Ready Ready Preview Comment Oct 17, 2025 9:49am
5 Skipped Deployments
Project Deployment Preview Comments Updated (UTC)
api-reference Skipped Skipped Oct 17, 2025 9:49am
developer-hub Skipped Skipped Oct 17, 2025 9:49am
entropy-explorer Skipped Skipped Oct 17, 2025 9:49am
proposals Skipped Skipped Oct 17, 2025 9:49am
staking Skipped Skipped Oct 17, 2025 9:49am

@fhqvst fhqvst force-pushed the fhqvst/ui-270-price-formatting-should-be-feed-exponent-aware branch from 6c9f78d to 6ec0108 Compare October 15, 2025 15:11
@vercel vercel bot temporarily deployed to Preview – developer-hub October 15, 2025 15:11 Inactive
@vercel vercel bot temporarily deployed to Preview – entropy-explorer October 15, 2025 15:11 Inactive
@vercel vercel bot temporarily deployed to Preview – api-reference October 15, 2025 15:11 Inactive
@vercel vercel bot temporarily deployed to Preview – staking October 15, 2025 15:11 Inactive
@vercel vercel bot temporarily deployed to Preview – proposals October 15, 2025 15:11 Inactive
@fhqvst fhqvst force-pushed the fhqvst/ui-270-price-formatting-should-be-feed-exponent-aware branch from 6ec0108 to 62df739 Compare October 17, 2025 09:42
@vercel vercel bot temporarily deployed to Preview – staking October 17, 2025 09:42 Inactive
@vercel vercel bot temporarily deployed to Preview – entropy-explorer October 17, 2025 09:43 Inactive
@vercel vercel bot temporarily deployed to Preview – api-reference October 17, 2025 09:43 Inactive
@vercel vercel bot temporarily deployed to Preview – proposals October 17, 2025 09:43 Inactive
@vercel vercel bot temporarily deployed to Preview – developer-hub October 17, 2025 09:43 Inactive
@fhqvst fhqvst self-assigned this Oct 17, 2025
@fhqvst fhqvst marked this pull request as ready for review October 17, 2025 09:43
@fhqvst fhqvst requested a review from a team as a code owner October 17, 2025 09:43
@fhqvst fhqvst force-pushed the fhqvst/ui-270-price-formatting-should-be-feed-exponent-aware branch from 62df739 to 54f0574 Compare October 17, 2025 09:46
@vercel vercel bot temporarily deployed to Preview – api-reference October 17, 2025 09:46 Inactive
@vercel vercel bot temporarily deployed to Preview – entropy-explorer October 17, 2025 09:46 Inactive
@vercel vercel bot temporarily deployed to Preview – proposals October 17, 2025 09:46 Inactive
@vercel vercel bot temporarily deployed to Preview – staking October 17, 2025 09:46 Inactive
@vercel vercel bot temporarily deployed to Preview – developer-hub October 17, 2025 09:46 Inactive
Copy link

@benduran benduran left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
LGTM

Copy link
Collaborator

@cprussin cprussin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should re-add formatToSubscriptNumber, but if you feel strongly about shipping this as-is I'm fine with it too

return useMemo(() => ({ format }), [format]);
};

const formatToSubscriptNumber = (numString: string) => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you should consider keeping this formatter, for some cryptos the pricing & CI are very very small fractions and you can have very long streams of zeroes which are very hard to read. This formatter resolves that issue quite nicely and can be applied on top of the exponentBasedFormatter.

screenshot-2025-10-17-095310

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants