Skip to content
This repository has been archived by the owner on Aug 22, 2021. It is now read-only.

Error on parseInt #68

Open
alemachado opened this issue Apr 4, 2019 · 0 comments
Open

Error on parseInt #68

alemachado opened this issue Apr 4, 2019 · 0 comments

Comments

@alemachado
Copy link

When used the number "1,990", the script generates "1,989".
That's why on the list generation of incremental numbers to display, when it calls the operation to preserve as int if input was int, it uses "parseInt": (row 54 : var newNum = Math.round(num / divisions * i);)

(1990 / 100 * 100) = 1989.9999999999998
parseInt(1990 / 100 * 100) = 1989

the script should use instead Math.round
Math.round(1990 / 100 * 100) = 1990

@alemachado alemachado changed the title Error on Parse.int Error on parseInt Apr 4, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant