show drive stats human readable
This commit is contained in:
@ -67,12 +67,18 @@ string Drive::sCapacityToText()
|
||||
|
||||
|
||||
string Drive::sPowerOnHoursToText(){
|
||||
double dYears = 0U;
|
||||
uint32_t u32Hours = getPowerOnHours();
|
||||
stringstream stream;
|
||||
|
||||
//TODO show in human readable format
|
||||
|
||||
return to_string(getPowerOnHours());
|
||||
dYears = (double) ((double)u32Hours/(double)8760U);
|
||||
|
||||
stream << fixed << setprecision(2) << dYears;
|
||||
string sRet = to_string(getPowerOnHours()) + " hours or " + stream.str() + " years";
|
||||
|
||||
return sRet;
|
||||
}
|
||||
|
||||
string Drive::sPowerCyclesToText(){
|
||||
return to_string(getPowerCycles());
|
||||
}
|
||||
|
Reference in New Issue
Block a user