Skip to content

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

Merged
nscuro merged 2 commits into
DependencyTrack:masterfrom
setchy:fix/percentage-tenth-decimal
Jan 28, 2024
Merged

fix(common): calculate percentage to tenth decimal place#708
nscuro merged 2 commits into
DependencyTrack:masterfrom
setchy:fix/percentage-tenth-decimal

Conversation

@setchy

@setchy setchy commented Jan 28, 2024

Copy link
Copy Markdown
Contributor

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

Signed-off-by: Adam Setch <adam.setch@outlook.com>
@setchy
setchy force-pushed the fix/percentage-tenth-decimal branch from 683cfda to 3f5f955 Compare January 28, 2024 15:47
Signed-off-by: Adam Setch <adam.setch@outlook.com>
@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

@nscuro nscuro left a comment

Copy link
Copy Markdown
Member

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
@setchy
setchy deleted the fix/percentage-tenth-decimal branch February 21, 2024 21:21
heyiamwahab236 pushed a commit to tecan/frontend_custom that referenced this pull request Jun 17, 2026
…th-decimal

fix(common): calculate percentage to tenth decimal place
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