Skip to content

Commit

Permalink
balances: format output
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Jul 9, 2023
1 parent ffe6195 commit 6eeef8f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tasks/balances.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ const fetchZRC20Balance = async (address: string) => {
const balance = await contract.balanceOf(address);
const denom = networks[networkName].assets[0].symbol;
if (balance > 0) {
return `${hre.ethers.utils.formatEther(balance)} ${denom}`;
const b = parseFloat(hre.ethers.utils.formatEther(balance)).toFixed(2);
return `${b} ${denom}`;
}
} catch (error) {}
});
Expand Down

0 comments on commit 6eeef8f

Please sign in to comment.