From c03797a535089d458dffec3ff64ba052542860ed Mon Sep 17 00:00:00 2001 From: Ken Moore Date: Mon, 3 Oct 2016 12:11:55 -0400 Subject: Fix the bytes to display function in the case where the number of bytes *exactly* matches the unit found (1G, 1M, 1K, etc). --- src-qt5/core/libLumina/LuminaUtils.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src-qt5') 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]); } -- cgit