mirror of
https://github.com/fleetdm/fleet
synced 2026-05-23 00:49:03 +00:00
UI: Fix live policy response percentage rounding (#28719)
## For #27052 - Use `round` instead of `ceil` and `floor` <img width="144" alt="Screenshot 2025-04-30 at 10 20 09 PM" src="https://github.com/user-attachments/assets/48a64558-6aca-4cd0-be9e-a526f9e6219d" /> - [x] Changes file added for user-visible changes in `changes/` - [x] Manual QA for all new/changed functionality --------- Co-authored-by: Jacob Shandling <jacob@fleetdm.com>
This commit is contained in:
parent
ee3872c2f5
commit
2beed5a2ec
2 changed files with 3 additions and 2 deletions
1
changes/27052-round-live-policy-percentages
Normal file
1
changes/27052-round-live-policy-percentages
Normal file
|
|
@ -0,0 +1 @@
|
|||
- Fix a small bug with the way live policy result percentages were being rounded
|
||||
|
|
@ -144,11 +144,11 @@ const PolicyResults = ({
|
|||
{" "}
|
||||
(Yes:{" "}
|
||||
<TooltipWrapper tipContent={`${yesCt} host${yesCt !== 1 ? "s" : ""}`}>
|
||||
{Math.ceil((yesCt / uiHostCounts.successful) * 100)}%
|
||||
{Math.round((yesCt / uiHostCounts.successful) * 100)}%
|
||||
</TooltipWrapper>
|
||||
, No:{" "}
|
||||
<TooltipWrapper tipContent={`${noCt} host${noCt !== 1 ? "s" : ""}`}>
|
||||
{Math.floor((noCt / uiHostCounts.successful) * 100)}%
|
||||
{Math.round((noCt / uiHostCounts.successful) * 100)}%
|
||||
</TooltipWrapper>
|
||||
)
|
||||
</span>
|
||||
|
|
|
|||
Loading…
Reference in a new issue