Round total memory to one decimal place.

This commit is contained in:
Roman Telezhynskyi 2023-10-13 12:51:26 +03:00
parent bb0a573e88
commit f430dbae1f

View File

@ -131,7 +131,7 @@ auto GetSystemMemorySizeGB() -> double
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
auto TotalMemory() -> QString auto TotalMemory() -> QString
{ {
double size = GetSystemMemorySizeGB(); double size = qRound(GetSystemMemorySizeGB() * 10.0) / 10.0;
return !qFuzzyCompare(size, -1.0) ? QStringLiteral("%1 GB").arg(size) : QStringLiteral("Unknown RAM"); return !qFuzzyCompare(size, -1.0) ? QStringLiteral("%1 GB").arg(size) : QStringLiteral("Unknown RAM");
} }
} // namespace } // namespace