aboutsummaryrefslogtreecommitdiff
path: root/modules/anticaps.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-05-20 17:49:02 +0100
committerGravatar Sadie Powell2026-05-20 17:49:02 +0100
commit5c9442d7db6e53cac73166e97cc8a7779e283acc (patch)
tree86a6d53e9abd32004a4654a944c6bba0f491b331 /modules/anticaps.cpp
parentMerge branch 'insp4' into master. (diff)
Add a helper function for calculating a percentage.
Diffstat (limited to 'modules/anticaps.cpp')
-rw-r--r--modules/anticaps.cpp3
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;