Commit 1865d9c3 authored by Igor Stuev's avatar Igor Stuev Committed by GitHub

Merge pull request #1145 from blockscout/token-rounding

fix tokens rounding
parents 23ad283e e347aaf4
......@@ -6,7 +6,7 @@ import * as tokenInstance from 'mocks/tokens/tokenInstance';
export const erc20a: AddressTokenBalance = {
token: tokens.tokenInfoERC20a,
token_id: null,
value: '1169320000000000000000000',
value: '1169321234567891234567891',
token_instance: null,
};
......
......@@ -19,7 +19,7 @@ const TokenSelectItem = ({ data }: Props) => {
switch (data.token.type) {
case 'ERC-20': {
const tokenDecimals = Number(data.token.decimals) || 18;
const text = `${ BigNumber(data.value).dividedBy(10 ** tokenDecimals).toFormat(2) } ${ data.token.symbol || '' }`;
const text = `${ BigNumber(data.value).dividedBy(10 ** tokenDecimals).dp(8).toFormat() } ${ data.token.symbol || '' }`;
return (
<>
......
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