Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(common): calculate percentage to tenth decimal place #708

Merged
merged 2 commits into from
Jan 28, 2024

Conversation

setchy
Copy link
Contributor

@setchy setchy commented Jan 28, 2024

Description

Refactor calcProgressPercent to found to the tenth decimal place, as per the functions comment/description.

/**
 * Given a total number of something and a lower number that is completed,
 * function will return a percentage rounded to the tenth decimal place.
 */

Also changed the order of the if statements to better flow.

Addressed Issue

Previous logic was rounding to the nearest integer.

Previous logic

Additional Details

Checklist

@setchy setchy force-pushed the fix/percentage-tenth-decimal branch from 683cfda to 3f5f955 Compare January 28, 2024 15:47
@nscuro nscuro added the enhancement New feature or request label Jan 28, 2024
@nscuro nscuro added this to the 4.11 milestone Jan 28, 2024
Copy link
Member

@nscuro nscuro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @setchy, appreciate all the tweaking!

@nscuro nscuro merged commit a2b249b into DependencyTrack:master Jan 28, 2024
9 checks passed
@setchy setchy deleted the fix/percentage-tenth-decimal branch February 21, 2024 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants