Skip to content

Commit

Permalink
FIxed rounding issue
Browse files Browse the repository at this point in the history
  • Loading branch information
MIDAV0 committed Sep 6, 2023
1 parent ad6872f commit 3218a1d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/renderer/components/Task.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,9 @@ function Task({ task, goBack }: TaskProps) {
? Math.round((totalRewardedAmount / scaledDataStakedBalance) * 1000) / 10
: 0;

const initialBalance =
Math.round((scaledDataStakedBalance - totalRewardedAmount) * 100) / 100;

const { data: dataApprove, writeAsync: writeAsyncApprove } = useContractWrite(
{
address: FLOCK_ADDRESS as `0x${string}`,
Expand Down Expand Up @@ -745,7 +748,7 @@ function Task({ task, goBack }: TaskProps) {
</Heading>
<Heading level="6" margin="0">
$F
{scaledDataStakedBalance - totalRewardedAmount}
{initialBalance}
</Heading>
</Box>
</Box>
Expand Down

0 comments on commit 3218a1d

Please sign in to comment.