Skip to content

Commit 0cf9109

Browse files
author
tiltom
authored
SOV-4868: Fix dollar values (#1077)
* Fix dollar values * Create strange-ties-relate.md * Force rebuild
1 parent 9bb38d3 commit 0cf9109

2 files changed

Lines changed: 9 additions & 7 deletions

File tree

.changeset/strange-ties-relate.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"frontend": patch
3+
---
4+
5+
SOV-4868: Fix dollar values

apps/frontend/src/hooks/useDollarValue.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ export function useDollarValue(
6363
STABLECOINS[chain]?.includes(destination))
6464
) {
6565
const amount = Number(fromWei(weiAmount, assetDetails?.decimals || 18));
66+
6667
return toDisplayPrice(
6768
amount,
6869
destinationDetails?.decimals || 18,
@@ -71,22 +72,18 @@ export function useDollarValue(
7172
} else {
7273
const amount = Decimal.fromBigNumberString(weiAmount)
7374
.mul(usdPrice)
74-
.toNumber();
75+
.toString();
7576

76-
return toDisplayPrice(
77-
amount,
78-
destinationDetails?.decimals || 18,
79-
assetDetails?.decimals || 18,
80-
).toString();
77+
return amount;
8178
}
8279
}, [
8380
entry,
8481
destination,
8582
chain,
8683
weiAmount,
87-
usdPrice,
8884
assetDetails?.decimals,
8985
destinationDetails?.decimals,
86+
usdPrice,
9087
]);
9188

9289
return {

0 commit comments

Comments
 (0)