diff --git a/src/util/Helpers.cpp b/src/util/Helpers.cpp index d4d4c6173..d780910a0 100644 --- a/src/util/Helpers.cpp +++ b/src/util/Helpers.cpp @@ -162,24 +162,6 @@ QString shortenString(const QString &str, unsigned maxWidth) return shortened; } -QString localizeNumbers(const int &number) -{ - QLocale locale; - return locale.toString(number); -} - -QString localizeNumbers(unsigned int number) -{ - QLocale locale; - return locale.toString(number); -} - -QString localizeNumbers(qsizetype number) -{ - QLocale locale; - return locale.toString(number); -} - QString kFormatNumbers(const int &number) { return QString("%1K").arg(number / 1000); diff --git a/src/util/Helpers.hpp b/src/util/Helpers.hpp index 34a374d43..b2b64d7e4 100644 --- a/src/util/Helpers.hpp +++ b/src/util/Helpers.hpp @@ -1,6 +1,7 @@ #pragma once #include +#include #include #include @@ -72,9 +73,12 @@ QString formatRichNamedLink(const QString &url, const QString &name, QString shortenString(const QString &str, unsigned maxWidth = 50); -QString localizeNumbers(const int &number); -QString localizeNumbers(unsigned int number); -QString localizeNumbers(qsizetype number); +template +QString localizeNumbers(T number) +{ + QLocale locale; + return locale.toString(number); +} QString kFormatNumbers(const int &number);