fixed capacity display

This commit is contained in:
Hendrik Schutter 2020-08-06 11:51:13 +02:00
parent 4c6aa1f19c
commit c13182b77f

View File

@ -47,13 +47,13 @@ uint32_t Drive::getPowerCycles(void)
} }
string Drive::sCapacityToText() { string Drive::sCapacityToText() {
if(getCapacity() <= (999*1000000000U)) { if(getCapacity() <= (999*1000000000UL)) {
// Less or even 999 GB --> GB // Less or even 999 GB --> GB
return to_string(getCapacity() / 1000000000U) + " GB"; return to_string(getCapacity() / 1000000000UL) + " GB";
} }
else { else {
// More 999 GB --> TB // More 999 GB --> TB
return to_string(getCapacity() / 1000000000000U) + " TB"; return to_string(getCapacity() / 1000000000000UL) + " TB";
} }
return "ERROR"; return "ERROR";
} }