Skip to content

Commit

Permalink
fix: convert string to number
Browse files Browse the repository at this point in the history
  • Loading branch information
vien.nguyen2-tiki committed Jan 18, 2023
1 parent 4b8e7e4 commit e9b2737
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion views/accounts/AddressOverview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const AddressOverview = ({ validator, address, addressData }: Props) => {
currency={
astraSummary && addressData.balance
? `(${formatCurrencyValue(
(astraSummary.last * parseInt(addressData.balance)) / 10 ** 18,
(Number(astraSummary.last) * parseInt(addressData.balance)) / 10 ** 18,
'VND'
)})`
: ''
Expand Down
4 changes: 3 additions & 1 deletion views/accounts/tabs/AddressTokenTab/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@ const AddressTokenTab = ({ address, addressData }: Props) => {
setPage(value)
}

const netWorth = numeral((astraSummary?.last * parseInt(addressData?.balance)) / 10 ** 18).format('0,0.00000')
const netWorth = numeral((Number(astraSummary?.last) * parseInt(addressData?.balance)) / 10 ** 18).format(
'0,0.00000'
)

return (
<div className="margin-left-xl margin-right-xl">
Expand Down
2 changes: 1 addition & 1 deletion views/homepage/Price.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Price = ({ classes }: Props) => {
)
}

const delta = (astraSummary.last / astraSummary.open - 1) * 100
const delta = (Number(astraSummary.last) / Number(astraSummary.open) - 1) * 100
const deltaText = delta >= 0 ? `+${numeral(delta).format('0.00')}` : numeral(delta).format('0.00')
const deltaStyle = delta == 0 ? 'warning' : delta > 0 ? 'success' : 'error'
return (
Expand Down

0 comments on commit e9b2737

Please sign in to comment.