tahackr / coin-tracker

An extension to track coin prices
0 stars 0 forks source link

Implementation of Currency Formatter #5

Closed Zoz-trk closed 1 year ago

Zoz-trk commented 1 year ago
tahackr commented 1 year ago

Used Intl.NumberFormat to format the Market Cap value. Also realized coins that have a price below 1 dollar, is rendered with 2 decimal places and it doesn't make any sense. So now we are conditionally rendering prices and if the price is under 1 dollar we render it with 6 decimal places.

Zoz-trk commented 1 year ago

@tahackr 2 decimal place is actually industry standart for most the application in terms of price metric. Instead of showing this $0.563422, please show this: $0.56

tahackr commented 1 year ago

Prices of some popular alt coins like Shiba Inu https://tr.investing.com/crypto/shiba-inu/shib-usd would be rendered as $0.00. I think for those coins we can go for 6 decimal places. Coins that have a value over 1 dollar will be shown with 2 decimal places. Are you okay with this?