diff --git a/apps/govern/components/Contracts/ContractsList.tsx b/apps/govern/components/Contracts/ContractsList.tsx index 7a8fac90..5b551a6e 100644 --- a/apps/govern/components/Contracts/ContractsList.tsx +++ b/apps/govern/components/Contracts/ContractsList.tsx @@ -58,9 +58,13 @@ const getColumns = ({ dataIndex: 'currentWeight', render: (currentWeight) => ( - {`${currentWeight?.percentage.toFixed(2)}%`} + {`${formatWeiNumber({ + value: currentWeight?.percentage, + maximumFractionDigits: 3, + })}%`} {`${formatWeiNumber({ value: currentWeight?.value, + maximumFractionDigits: 3, })} veOLAS`} ), @@ -71,8 +75,14 @@ const getColumns = ({ dataIndex: 'nextWeight', render: (nextWeight) => ( - {`${nextWeight?.percentage.toFixed(2)}%`} - {`${formatWeiNumber({ value: nextWeight?.value })} veOLAS`} + {`${formatWeiNumber({ + value: nextWeight?.percentage, + maximumFractionDigits: 3, + })}%`} + {`${formatWeiNumber({ + value: nextWeight?.value, + maximumFractionDigits: 3, + })} veOLAS`} ), }, diff --git a/apps/govern/components/Contracts/EditVotes/ConfirmModal.tsx b/apps/govern/components/Contracts/EditVotes/ConfirmModal.tsx index c8ce107e..cfab0ab8 100644 --- a/apps/govern/components/Contracts/EditVotes/ConfirmModal.tsx +++ b/apps/govern/components/Contracts/EditVotes/ConfirmModal.tsx @@ -1,6 +1,7 @@ import { Alert, Modal, Typography } from 'antd'; import { MAX_ALLOCATED_POWER } from './utils'; +import { formatWeiNumber } from 'libs/util-functions/src'; const { Paragraph } = Typography; @@ -30,9 +31,10 @@ export const ConfirmModal = ({ confirmLoading={isLoading} > - {`You're allocating ${parseFloat( - (allocatedPower / 100).toFixed(2), - )}% of your voting power to ${allocationsLength} staking contracts.`} + {`You're allocating ${formatWeiNumber({ + value: allocatedPower / 100, + maximumFractionDigits: 3, + })}% of your voting power to ${allocationsLength} staking contracts.`} {`After you confirm, you'll enter a 10 day cooldown period. You won't be able to update your weights during that time.`} @@ -42,9 +44,10 @@ export const ConfirmModal = ({ )} diff --git a/apps/govern/components/Contracts/EditVotes/index.tsx b/apps/govern/components/Contracts/EditVotes/index.tsx index c4913615..0470fc40 100644 --- a/apps/govern/components/Contracts/EditVotes/index.tsx +++ b/apps/govern/components/Contracts/EditVotes/index.tsx @@ -24,6 +24,7 @@ import { checkNoRemovedNominees, checkNotNegativeSlope, } from './validations'; +import { formatWeiNumber } from 'libs/util-functions/src'; const { Paragraph, Text } = Typography; @@ -72,6 +73,7 @@ const getColumns = ( step={0.01} controls={false} value={allocations[index].weight} + precision={3} status={isError ? 'error' : undefined} onChange={(value) => { if (typeof value === 'number') { @@ -190,7 +192,10 @@ export const EditVotes = ({ allocations, setAllocations, setIsUpdating }: EditVo }); }, [account, allocations, dispatch, stakingContracts, allocatedPower, userVotes, setIsUpdating]); - const totalAllocatedPower = parseFloat((allocatedPower / 100).toFixed(2)); + const totalAllocatedPower = formatWeiNumber({ + value: allocatedPower / 100, + maximumFractionDigits: 3, + }); return ( <> diff --git a/apps/govern/components/Donate/index.tsx b/apps/govern/components/Donate/index.tsx index 4269a497..6626b4a6 100644 --- a/apps/govern/components/Donate/index.tsx +++ b/apps/govern/components/Donate/index.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ import { Alert, Button, Card, Skeleton, Typography } from 'antd'; import { ethers } from 'ethers'; import isNumber from 'lodash/isNumber'; @@ -169,7 +170,7 @@ export const DonatePage = () => { - + {/* Epoch Status @@ -197,7 +198,7 @@ export const DonatePage = () => { New epochs must be manually triggered by community members - + */} ); };