bfintal / Counter-Up

Counter-Up is a lightweight jQuery plugin that counts up to a targeted number when the number becomes visible.
http://bfintal.github.io/Counter-Up/demo/demo.html
GNU General Public License v2.0
746 stars 722 forks source link

Try using 1981 #36

Open stuffthatspins opened 7 years ago

stuffthatspins commented 7 years ago

1981 resolves to 1980...

ghost commented 7 years ago

Hello, I found some strange bugs.. if i enter 1999 then it's counts till 1998..Also same for 1981 it's counts till 1980. Can you please guide ? Thanks, Ajay

adrigm commented 7 years ago

Change this line:

var newNum = parseInt(num / divisions * i);

for:

var newNum = parseInt(Math.round(num / divisions * i));
ciromattia commented 7 years ago

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

ShawnRamseyMedia commented 5 years ago

I tried this and it worked - from: var l = parseInt(i / n * f); to var l = parseInt(Math.round(i / n * f));

JavaOPs commented 5 years ago

The same problem for 1706. Take fix from https://raw.githubusercontent.com/ciromattia/jquery.counterup/master/jquery.counterup.min.js Thak you!