aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Moore <ken@ixsystems.com>2016-10-03 12:11:55 -0400
committerKen Moore <ken@ixsystems.com>2016-10-03 12:11:55 -0400
commitc03797a535089d458dffec3ff64ba052542860ed (patch)
tree1d89c7f8ff2a4721e1961ad8545e0d3a8724142f
parentRe-enable all the keyboard shortcuts for lumina-fm (and a few extras). All th... (diff)
downloadlumina-c03797a535089d458dffec3ff64ba052542860ed.tar.gz
lumina-c03797a535089d458dffec3ff64ba052542860ed.tar.bz2
lumina-c03797a535089d458dffec3ff64ba052542860ed.zip
Fix the bytes to display function in the case where the number of bytes *exactly* matches the unit found (1G, 1M, 1K, etc).
-rw-r--r--src-qt5/core/libLumina/LuminaUtils.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src-qt5/core/libLumina/LuminaUtils.cpp b/src-qt5/core/libLumina/LuminaUtils.cpp
index 8a35be6b..db165cf2 100644
--- a/src-qt5/core/libLumina/LuminaUtils.cpp
+++ b/src-qt5/core/libLumina/LuminaUtils.cpp
@@ -410,13 +410,14 @@ QString LUtils::BytesToDisplaySize(qint64 ibytes){
}else if(bytes>=10){
//need 1 decimel place
num = QString::number( (qRound(bytes*10)/10.0) );
- }else if(bytes>1){
+ }else if(bytes>=1){
//need 2 decimel places
num = QString::number( (qRound(bytes*100)/100.0) );
}else{
//Fully decimel (3 places)
num = "0."+QString::number(qRound(bytes*1000));
}
+ //qDebug() << "Bytes to Human-readable:" << bytes << c << num << labs[c];
return (num+labs[c]);
}
bgstack15