Skip to content

Commit 6bc2777

Browse files
authored
Merge pull request #821 from subquery/fix/float
fix: float
2 parents 2916bd2 + c67303d commit 6bc2777

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

src/components/DoAllocate/DoAllocate.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -395,9 +395,11 @@ const DoAllocate: FC<IProps> = ({ projectId, deploymentId, actionBtn, onSuccess,
395395
</Typography>
396396
</div>
397397
<span style={{ flex: 1 }}></span>
398-
<Typography variant="medium" style={{ overflowWrap: 'anywhere' }}>
399-
{avaibleStakeAmount} {TOKEN}
400-
</Typography>
398+
<Tooltip title={BigNumber(avaibleStakeAmount).toFixed(18)}>
399+
<Typography variant="medium" style={{ overflowWrap: 'anywhere' }}>
400+
{BigNumber(avaibleStakeAmount).toFixed(2)} {TOKEN}
401+
</Typography>
402+
</Tooltip>
401403
</div>
402404
<div className="flex">
403405
<Typography variant="medium" type="secondary">

src/components/DoBooster/index.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import { useDeploymentMetadata, useProjectFromQuery } from '@hooks';
1414
import { useAddAllowance } from '@hooks/useAddAllowance';
1515
import { useWaitTransactionhandled } from '@hooks/useWaitTransactionHandled';
1616
import { Modal, openNotification, Spinner, Steps, Tag, Typography } from '@subql/components';
17-
import { formatSQT, useGetDeploymentBoosterTotalAmountByDeploymentIdQuery } from '@subql/react-hooks';
17+
import { useGetDeploymentBoosterTotalAmountByDeploymentIdQuery } from '@subql/react-hooks';
1818
import { cidToBytes32, parseError, TOKEN } from '@utils';
19-
import { formatNumber } from '@utils/numberFormatters';
19+
import { formatNumber, formatSQT } from '@utils/numberFormatters';
2020
import { Button, Form, Radio, Tooltip } from 'antd';
2121
import { useForm, useWatch } from 'antd/es/form/Form';
2222
import BigNumberJs from 'bignumber.js';
@@ -331,7 +331,9 @@ const DoBooster: FC<IProps> = ({
331331
{balance.result.loading ? (
332332
<Spinner size={10}></Spinner>
333333
) : (
334-
formatSQT(balance.result.data?.toString() || '0')
334+
<Tooltip title={formatSQT(balance.result.data?.toString() || '0', { fixedNum: 18 })}>
335+
{formatSQT(balance.result.data?.toString() || '0', { fixedNum: 2 })}
336+
</Tooltip>
335337
)}{' '}
336338
{TOKEN}
337339
</Typography>

0 commit comments

Comments
 (0)