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

Number not showing exact number #47

Open
nikunj1990 opened this issue Feb 20, 2017 · 4 comments
Open

Number not showing exact number #47

nikunj1990 opened this issue Feb 20, 2017 · 4 comments

Comments

@nikunj1990
Copy link

Hello,

For eg. i added 60,056 and when it count and finish it shows 60,055 and 107,235 shows 107,234

@nikunj1990
Copy link
Author

we have resolved this issue...

for (var i = divisions; i >= 1; i--) {

            // Preserve as int if input was int
            **var newNum = Math.round(num / divisions * i);** // replace ParseInt with Math.round code in couter-up js

            // Preserve float if input was float
            if (isFloat) {
                newNum = parseFloat(num / divisions * i).toFixed(decimalPlaces);
            }

            // Preserve commas if input had commas
            if (isComma) {
                while (/(\d+)(\d{3})/.test(newNum.toString())) {
                    newNum = newNum.toString().replace(/(\d+)(\d{3})/, '$1'+','+'$2');
                }
            }

            nums.unshift(newNum);
        }

@ciromattia
Copy link

It should be fixed in my fork, can you tell me if it's working for you?
Thanks!

@mcoirad
Copy link

mcoirad commented Apr 5, 2017

@nikunj1990 Thanks, you saved me with your fix. My problem happened to be with the number 205 showing up as 204.

@ciromattia I couldn't get your fork to work but that just might be something on my end.

@itsKnight847
Copy link

@ciromattia you are life saver, updating the library solved it!

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

4 participants