1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-08 08:54:49 -04:00

GLSpectrum: factorized displayScaledF and displayScaledM

This commit is contained in:
f4exb
2020-07-06 10:57:58 +02:00
parent eaca7102c6
commit d2396d1f3d
3 changed files with 37 additions and 30 deletions
+5 -1
View File
@@ -2314,7 +2314,11 @@ QString GLScope::displayScaled(float value, char type, int precision)
{
float posValue = (value < 0) ? -value : value;
if (posValue < 1)
if (posValue == 0)
{
return tr("%1").arg(QString::number(value, 'f', precision));
}
else if (posValue < 1)
{
if (posValue > 0.001) {
return tr("%1m").arg(QString::number(value * 1000.0, type, precision));