diff options
| author | 2026-05-20 17:49:02 +0100 | |
|---|---|---|
| committer | 2026-05-20 17:49:02 +0100 | |
| commit | 5c9442d7db6e53cac73166e97cc8a7779e283acc (patch) | |
| tree | 86a6d53e9abd32004a4654a944c6bba0f491b331 /modules/sslinfo.cpp | |
| parent | Merge branch 'insp4' into master. (diff) | |
Add a helper function for calculating a percentage.
Diffstat (limited to 'modules/sslinfo.cpp')
| -rw-r--r-- | modules/sslinfo.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/sslinfo.cpp b/modules/sslinfo.cpp index 66cfca3c3..19b51afe6 100644 --- a/modules/sslinfo.cpp +++ b/modules/sslinfo.cpp @@ -37,6 +37,7 @@ #include "numerichelper.h" #include "stringutils.h" #include "timeutils.h" +#include "utility/numeric.h" struct RemoteCertificate final : public TLS::Certificate @@ -616,7 +617,7 @@ public: if (!count) continue; - const auto percent = total ? round((count * 100) / total) : 0; + const auto percent = insp::percentage(count, total); stats.AddGenericRow(FMT::format("{}: {} ({:3.2f}%)", ciphersuite, count, percent)) .AddTags(stats, { { "ciphersuite", ciphersuite }, |
