Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
mondoreale committed May 2, 2024
1 parent e7ed55b commit 6ec4615
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/Stats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ function networkMetricValueFormatter(metricKey: NetworkMetricKey, value: number)
return `${value.toFixed(2)}%`
}

if (metricKey === 'tvl') {
return value < 10 ** 6 ? value.toPrecision(4) : `${(value / 10 ** 6).toPrecision(4)}M`
if (metricKey === 'tvl' && value >= 10 ** 6) {
return `${(value / 10 ** 6).toPrecision(4)}M`
}

return value.toPrecision(4)
Expand Down

0 comments on commit 6ec4615

Please sign in to comment.