diff options
| author | 2026-05-20 17:49:02 +0100 | |
|---|---|---|
| committer | 2026-05-20 17:49:02 +0100 | |
| commit | 5c9442d7db6e53cac73166e97cc8a7779e283acc (patch) | |
| tree | 86a6d53e9abd32004a4654a944c6bba0f491b331 /modules/anticaps.cpp | |
| parent | Merge branch 'insp4' into master. (diff) | |
Add a helper function for calculating a percentage.
Diffstat (limited to 'modules/anticaps.cpp')
| -rw-r--r-- | modules/anticaps.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/anticaps.cpp b/modules/anticaps.cpp index 68f7cd1e4..8500d1145 100644 --- a/modules/anticaps.cpp +++ b/modules/anticaps.cpp @@ -23,6 +23,7 @@ #include "extension.h" #include "modules/exemption.h" #include "numerichelper.h" +#include "utility/numeric.h" enum class AntiCapsMethod : uint8_t @@ -275,7 +276,7 @@ public: return MOD_RES_PASSTHRU; // Calculate the percentage. - double percent = round((upper * 100) / length); + const auto percent = insp::percentage(upper, length); if (percent < config->percent) return MOD_RES_PASSTHRU; |
