Skip to content

Progress label not working as expected #47

@mirko-console-dir

Description

@mirko-console-dir

Describe the bug
The progress label doesn't show the correct number due for the Math.floor I suggest to use Math.ceil instead
index.js line 36
return setLabelValue(Math.floor((value / 100) * max));

To Reproduce
let totActivity: any = 0
for(let i = 0, len = activity[keyName].length; i < len; i++){
totActivity += activity[keyName][i].total
}
console.log('totActivity ', totActivity)
// log: totActivity 2

       <AnimatedProgressWheel 
            ...
            progress={totalActivity}
           />

Expected behavior
the totalActivity is 2 but in the wheel label is showing just 1 due to the Math.floor previously mentioned I suppose, when change to Math.ceil all works fine

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions