explorer: Display more decimals for small token prices (#21276)
This commit is contained in:
@ -108,8 +108,12 @@ function FungibleTokenMintAccountCard({
|
|||||||
const coinInfo = useCoinGecko(tokenInfo?.extensions?.coingeckoId);
|
const coinInfo = useCoinGecko(tokenInfo?.extensions?.coingeckoId);
|
||||||
|
|
||||||
let tokenPriceInfo;
|
let tokenPriceInfo;
|
||||||
|
let tokenPriceDecimals = 2;
|
||||||
if (coinInfo?.status === CoingeckoStatus.Success) {
|
if (coinInfo?.status === CoingeckoStatus.Success) {
|
||||||
tokenPriceInfo = coinInfo.coinInfo;
|
tokenPriceInfo = coinInfo.coinInfo;
|
||||||
|
if (tokenPriceInfo && tokenPriceInfo.price < 1) {
|
||||||
|
tokenPriceDecimals = 6;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@ -130,7 +134,7 @@ function FungibleTokenMintAccountCard({
|
|||||||
</span>
|
</span>
|
||||||
</h4>
|
</h4>
|
||||||
<h1 className="mb-0">
|
<h1 className="mb-0">
|
||||||
${tokenPriceInfo.price.toFixed(2)}{" "}
|
${tokenPriceInfo.price.toFixed(tokenPriceDecimals)}{" "}
|
||||||
{tokenPriceInfo.price_change_percentage_24h > 0 && (
|
{tokenPriceInfo.price_change_percentage_24h > 0 && (
|
||||||
<small className="change-positive">
|
<small className="change-positive">
|
||||||
↑{" "}
|
↑{" "}
|
||||||
|
Reference in New Issue
Block a user