Rounding Logic for Percentages
In all cases where we have a distribution of overall employees based on categories (like sentiment or participation) and we show percentage of employees in each category, we round the percentage to nearest integer to keep the UI clean. But, we also need to ensure that the sum is 100% and post rounding we might see the sum as 99% or 101% as a 1% margin or error is being introduced by this rounding.
To make that happen, we round up/down the value where maximum difference was created due to the original rounding. Below examples showcase all 3 scenarios in case of participation to explain the logic better.
Sum post original rounding is 100%
Sum post original rounding is 99%
Sum post original rounding is 101%
Updated 8 days ago
