mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
parent
4923549fdf
commit
f9b23882f4
2 changed files with 7 additions and 21 deletions
|
@ -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);
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <QColor>
|
||||
#include <QLocale>
|
||||
#include <QString>
|
||||
#include <QStringRef>
|
||||
|
||||
|
@ -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 <typename T>
|
||||
QString localizeNumbers(T number)
|
||||
{
|
||||
QLocale locale;
|
||||
return locale.toString(number);
|
||||
}
|
||||
|
||||
QString kFormatNumbers(const int &number);
|
||||
|
||||
|
|
Loading…
Reference in a new issue