From 5c9442d7db6e53cac73166e97cc8a7779e283acc Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Wed, 20 May 2026 17:49:02 +0100 Subject: Add a helper function for calculating a percentage. --- modules/anticaps.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'modules/anticaps.cpp') 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; -- cgit v1.3.1-10-gc9f91