fixed bug for hash size display

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4040 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2011-02-16 22:33:44 +00:00
parent daad701f52
commit b7b8831f71

View File

@ -780,7 +780,7 @@ void FileIndexMonitor::updateCycle()
static std::string friendlyUnit(uint64_t val) static std::string friendlyUnit(uint64_t val)
{ {
const std::string units[4] = {"B","KB","MB","GB"}; const std::string units[5] = {"B","KB","MB","GB","TB"};
char buf[50] ; char buf[50] ;
double fact = 1.0 ; double fact = 1.0 ;
@ -794,7 +794,7 @@ static std::string friendlyUnit(uint64_t val)
else else
fact *= 1024.0f ; fact *= 1024.0f ;
sprintf(buf,"%2.2f",double(val)/fact) ; sprintf(buf,"%2.2f",double(val)/fact*1024.0f) ;
return std::string(buf) + " TB"; return std::string(buf) + " TB";
} }