Merge pull request #1145 from blockscout/token-rounding
fix tokens rounding
@@ -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,
|
||||
};
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 47 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 56 KiB |
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 41 KiB |
@@ -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 (
|
||||
<>
|
||||
|
||||
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 30 KiB After Width: | Height: | Size: 30 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 37 KiB |
|
Before Width: | Height: | Size: 37 KiB After Width: | Height: | Size: 38 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |