79093162

Date: 2024-10-16 08:40:39
Score: 0.5
Natty:
Report link

The simplest thing you can do is round the number to the appropriate decimal places before calling ethers.utils.parseUnits using toFixed or math rounding:

const n = '1.48389134738';
const decimals = 6;

ethers.utils.parseUnits(Number(n).toFixed(decimals), decimals);
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: nezort11