Commit 5e6e6be8 authored by Kaylee George's avatar Kaylee George Committed by GitHub

fix: fix decimal formatting of token price on details page (#4470)

* init

* 6 decimals

* dollar dollar bill yo
parent 79fb6485
...@@ -235,7 +235,7 @@ export function PriceChart({ width, height, token }: PriceChartProps) { ...@@ -235,7 +235,7 @@ export function PriceChart({ width, height, token }: PriceChartProps) {
return ( return (
<> <>
<ChartHeader> <ChartHeader>
<TokenPrice>${displayPrice.value.toFixed(2)}</TokenPrice> <TokenPrice>${displayPrice.value < 0.000001 ? '<0.000001' : displayPrice.value.toFixed(6)}</TokenPrice>
<DeltaContainer> <DeltaContainer>
{formattedDelta} {formattedDelta}
<ArrowCell>{arrow}</ArrowCell> <ArrowCell>{arrow}</ArrowCell>
......
...@@ -6,7 +6,7 @@ export const formatDollarAmount = (num: number | undefined, digits = 2, round = ...@@ -6,7 +6,7 @@ export const formatDollarAmount = (num: number | undefined, digits = 2, round =
if (num === 0) return '0' if (num === 0) return '0'
if (!num) return '-' if (!num) return '-'
if (num < 0.001 && digits <= 3) { if (num < 0.001 && digits <= 3) {
return '<0.001' return '$<0.001'
} }
return numbro(num) return numbro(num)
...@@ -26,7 +26,7 @@ export const formatAmount = (num: number | undefined, digits = 2) => { ...@@ -26,7 +26,7 @@ export const formatAmount = (num: number | undefined, digits = 2) => {
if (num === 0) return '0' if (num === 0) return '0'
if (!num) return '-' if (!num) return '-'
if (num < 0.001) { if (num < 0.001) {
return '<0.001' return '$<0.001'
} }
return numbro(num).format({ return numbro(num).format({
average: true, average: true,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment