Skip to content

Commit

Permalink
Update balance fomart
Browse files Browse the repository at this point in the history
  • Loading branch information
versedpro committed Mar 18, 2021
1 parent 501c5ec commit 4be0fab
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"@ethersproject/contracts": "^5.0.12",
"@ethersproject/providers": "^5.0.24",
"@ethersproject/solidity": "^5.0.10",
"@ethersproject/units": "^5.0.11",
"@pancakeswap-libs/sdk": "^1.0.1",
"@reduxjs/toolkit": "^1.5.0",
"@testing-library/jest-dom": "^5.11.4",
Expand Down
3 changes: 2 additions & 1 deletion src/views/Vault/components/VaultsListItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import DepositModal from './subcomponent/DespositModal';
import { UnsupportedChainIdError, useWeb3React } from '@web3-react/core'
import useSWR from 'swr'
import { Web3Provider } from '@ethersproject/providers'
import { formatEther } from '@ethersproject/units'

interface Item {
item: any;
Expand Down Expand Up @@ -92,7 +93,7 @@ const VaultsListItem: React.FC<Item> = ({ item }) => {
</WalletTitle>
<WalletValue>
<span style={{ color: "#6c757d", fontSize: "0.9em" }}>
{ balance? <div>Balance: {balance.toString()}</div> : <div>--</div> }
{ balance? <div>Balance: {parseFloat(formatEther(balance)).toPrecision(4)}</div> : <div>--</div> }
</span>
</WalletValue>
</WalletContent>
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "preserve"
"jsx": "react-jsx"
},
"include": [
"src"
Expand Down
14 changes: 14 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1595,6 +1595,15 @@
"@ethersproject/rlp" "^5.0.7"
"@ethersproject/signing-key" "^5.0.8"

"@ethersproject/units@^5.0.11":
version "5.0.11"
resolved "https://registry.npmjs.org/@ethersproject/units/-/units-5.0.11.tgz#f82f6e353ac0d6fa43b17337790f1f9aa72cb4c8"
integrity sha512-nOSPmcCWyB/dwoBRhhTtPGCsTbiXqmc7Q0Adwvafc432AC7hy3Fj3IFZtnSXsbtJ/GdHCIUIoA8gtvxSsFuBJg==
dependencies:
"@ethersproject/bignumber" "^5.0.13"
"@ethersproject/constants" "^5.0.8"
"@ethersproject/logger" "^5.0.8"

"@ethersproject/web@^5.0.12":
version "5.0.14"
resolved "https://registry.yarnpkg.com/@ethersproject/web/-/web-5.0.14.tgz#6e7bebdd9fb967cb25ee60f44d9218dc0803bac4"
Expand Down Expand Up @@ -14141,6 +14150,11 @@ swarm-js@^0.1.40:
tar "^4.0.2"
xhr-request "^1.0.1"

swr@^0.5.3:
version "0.5.3"
resolved "https://registry.npmjs.org/swr/-/swr-0.5.3.tgz#7290a9a61329d930583ef365317e636b8dbaa8bb"
integrity sha512-RUE3RWn3jt9e4qLPat2A9vbHG/5N6konsc27xKjE65jFSiGv0P7HLD8IGvwAv6DRKktL7Od2UcayX0plKb2awg==

symbol-observable@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-1.2.0.tgz#c22688aed4eab3cdc2dfeacbb561660560a00804"
Expand Down

0 comments on commit 4be0fab

Please sign in to comment.