How can I incorporate tokens into the script? For instance, I need to send tokens like USDT, and the token value might be something like 12.067. When I send this value, it sometimes doesn't transfer the correct amount. How can I handle these decimal values in the script?

        Math.floor(amounts ** 1e6)

I set this but still, it sends 10342.489 like this value.

1 Answer 1


first you should check how many decimals is used for the said token.

Once you have the correct amount of decimals, i never had any problem using something like 12067000000 for example if 9 decimals

  • Thanks for help
    – Bobz
    Oct 31, 2023 at 6:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.