pguso/js-plugin-circliful

The percent value change

fyzwjd opened this issue · 2 comments

I use the plugin to show 66.7%,
with{
alwaysDecimals: false
}
it display 68.
with{
alwaysDecimals: true,
decimals: 1
}
it display 68.4.
I debug the code and find that the parameter 'animationStep' cause the percent value to be unstable.
It can be fixed by [jquery.cirliful.js line 272]:

  if (!settings.alwaysDecimals && (percent === 0 || (percent > 1 && last !== 1))) {
     text = parseInt(text);
           if(text > settings.percent){
                text = parseInt(settings.percent);
            }
  }else{
       if(text > settings.percent){
          text = settings.percent.toFixed(settings.decimals);
       }
  }

Please confirm the problem and accept my suggestion if possible.

Thanks that is working somehow but the moderator is not supporting this plugin i think he should make an announcement to ask for moderators.

pguso commented

@fyzwjd implemented a customized version of your suggestion, please test and reopen ticket if something is missing. Thank you!