Skip to content

Commit

Permalink
fix: decimals (#353)
Browse files Browse the repository at this point in the history
  • Loading branch information
MrX-SNX authored Jul 9, 2024
1 parent e1f8a7e commit e019451
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion ultrasound/ui/components/SupplyChangeStats.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function SupplyChangeStats() {
Burnt
</Text>
<Text fontSize="18px" color="gray.500" fontWeight={700}>
{events?.totalBurned} SNX
{events ? events[selectedTime] : 0} SNX
</Text>
</Flex>
<Flex gap="2" alignItems="center">
Expand Down
9 changes: 6 additions & 3 deletions ultrasound/ui/hooks/useBurnEvents.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ export function useBurnEvents() {

const supplyChange7Days = events
.filter((event) => event.ts > now.getTime())
.reduce((cur, prev) => cur + prev.snxAmount, 0)
.toLocaleString();
.reduce((cur, prev) => cur + prev.snxAmount, 0);

const SNXPriceResponse = await fetch(
'https://coins.llama.fi/prices/current/ethereum:0xC011a73ee8576Fb46F5E1c5751cA3B9Fe0af2a6F'
Expand Down Expand Up @@ -89,8 +88,12 @@ export function useBurnEvents() {
}),
groupedByMonths,
groupedByLast30Days,
supplyChange7Days,
supplyChange7Days: supplyChange7Days.toLocaleString('en-US', {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}),
totalSupply: currentSupply.toLocaleString('en-US', {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
}),
SNXPrice:
Expand Down

0 comments on commit e019451

Please sign in to comment.