mistswapdex / mistswap-analytics

Analytics for the MistSwap protocol
https://analytics.mistswap.fi
1 stars 7 forks source link

Format currencies with maximum fraction digits of 2 #30

Closed mainnet-pat closed 3 years ago

mainnet-pat commented 3 years ago

Assess #23 Tiny currency formatter uses 2 fraction digits instead of 6.

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/mistswapdex/mistswap-analytics/3fot74Y6iqfNbDpBuZVc2dsSkfky
✅ Preview: https://mistswap-analytics-git-fork-mainnet-pat-tiny-80cb31-mistswapdex.vercel.app

kasumi-1 commented 3 years ago

This does not work for tokens with very low price. So we probably need new formatter.

mainnet-pat commented 3 years ago

formatCurrency now defaults to rounding to 2 fractional digits new function formatPrice rounds to 2 if price is above $10 otherwise to 6 digits. formatPrice is used in relevant places