Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rounding error when determining fee for Contract Transaction #146

Open
jimtendo opened this issue Mar 10, 2023 · 0 comments
Open

Rounding error when determining fee for Contract Transaction #146

jimtendo opened this issue Mar 10, 2023 · 0 comments

Comments

@jimtendo
Copy link

[In ](

) the following line can sometimes lead to an incorrect fee as it does a Math.ceil on the value.

This means that if JS's Math engine, for example, gave a result of something like 620.00000001 in the preceding math, the Math.ceil() would round this up to 621, causing an off-by-one error.

Math.round() will probably resolve this as, even with JS Math's inconsistencies, it should always round back to the correct target integer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant