Skip to content

Commit

Permalink
use double truncating...
Browse files Browse the repository at this point in the history
  • Loading branch information
KorbinianK committed Sep 5, 2023
1 parent 5d9f21c commit 900d028
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/bridge-ui-v2/src/libs/util/balance.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,7 @@ export function renderBalance(balance: Maybe<FetchBalanceResult>) {
}

export function renderEthBalance(balance: bigint, maxlength = 8): string {
let stringBalance = formatEther(balance).toString();
if (stringBalance.length > maxlength) {
stringBalance = stringBalance.slice(0, maxlength) + '...';
}

return `${truncateString(stringBalance, stringBalance.length, '')} ETH`;
return `${truncateString(formatEther(balance).toString(), maxlength, '')} ETH`;
}

export const refreshUserBalance = async () => {
Expand Down

0 comments on commit 900d028

Please sign in to comment.