inorganik / ngx-countUp

Animates a numerical value by counting to it - for Angular
MIT License
138 stars 25 forks source link

when value greater than 999, not count up expected #9

Closed rikan closed 6 years ago

rikan commented 6 years ago
[x] Bug
[ ] Build issue
[ ] Feature request

Version info

Angular: 5
Angular CLI: 
countup.js-angular2: 

Description

Hi @inorganik ,

when start value and end value both greater than 999, the component become count down, not count up expected.

for example start value is 100000 end value is 100099

I think the issue caused by this code.

    if (end > 999) {
      // make easing smoother for large numbers
      countUp = new CountUp(this.el.nativeElement, sta, end - 100, dec, dur / 2, this.options);
    }

Please have a look. Thanks.

inorganik commented 6 years ago

Ah, yes that is a bug. I'll make a fix soon. Thanks.

inorganik commented 6 years ago

Fixed in v6.0.0