Commit 1afc3645 authored by Jack Short's avatar Jack Short Committed by GitHub

fix: supporting commas (#5472)

parent 1b65d6a1
...@@ -126,7 +126,11 @@ type NftAssetsQueryAsset = NonNullable< ...@@ -126,7 +126,11 @@ type NftAssetsQueryAsset = NonNullable<
function formatAssetQueryData(queryAsset: NftAssetsQueryAsset, totalCount?: number) { function formatAssetQueryData(queryAsset: NftAssetsQueryAsset, totalCount?: number) {
const asset = queryAsset.node const asset = queryAsset.node
const ethPrice = parseEther( const ethPrice = parseEther(
asset.listings?.edges[0]?.node.price.value?.toLocaleString('fullwide', { useGrouping: false }) ?? '0' parseFloat(
(asset.listings?.edges[0]?.node.price.value?.toLocaleString('fullwide', { useGrouping: false }) ?? '0')
.replace(',', '.')
.replace(' ', '')
).toString()
).toString() ).toString()
return { return {
id: asset.id, id: asset.id,
......
...@@ -168,7 +168,11 @@ export function useNftBalanceQuery( ...@@ -168,7 +168,11 @@ export function useNftBalanceQuery(
const walletAssets: WalletAsset[] = data.nftBalances?.edges?.map((queryAsset: NftBalanceQueryAsset) => { const walletAssets: WalletAsset[] = data.nftBalances?.edges?.map((queryAsset: NftBalanceQueryAsset) => {
const asset = queryAsset.node.ownedAsset const asset = queryAsset.node.ownedAsset
const ethPrice = parseEther( const ethPrice = parseEther(
asset?.listings?.edges[0]?.node.price.value?.toLocaleString('fullwide', { useGrouping: false }) ?? '0' parseFloat(
(asset?.listings?.edges[0]?.node.price.value?.toLocaleString('fullwide', { useGrouping: false }) ?? '0')
.replace(',', '.')
.replace(' ', '')
).toString()
).toString() ).toString()
return { return {
id: asset?.id, id: asset?.id,
......
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