Skip to content

Commit

Permalink
refactor: use decimal directly
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick-1979 committed Nov 11, 2024
1 parent 7c856fe commit ac46aba
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions packages/extension-polkagate/src/components/FormatPrice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,6 @@ function FormatPrice ({ amount, commify, decimalPoint = 2, decimals, fontSize, f
return decimalPoint;
}, [currency?.code, decimalPoint]);

const TotalAsNumber = useMemo(() => {
const temp = fixFloatingPoint(total as number, _decimalPoint);

return parseFloat(temp);
}, [_decimalPoint, total]);

return (
<Grid
item
Expand All @@ -101,9 +95,9 @@ function FormatPrice ({ amount, commify, decimalPoint = 2, decimals, fontSize, f
>
{withCountUp
? <CountUp
decimals={countDecimalPlaces(TotalAsNumber)}
decimals={_decimalPoint}
duration={1}
end={TotalAsNumber}
end={parseFloat(String(total))}
prefix={sign || currency?.sign || ''}
/>
: <>
Expand Down

0 comments on commit ac46aba

Please sign in to comment.