small fixes in number display

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7613 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-10-15 22:16:23 +00:00
parent 8c1bf3cf8d
commit 01fdb95c30
2 changed files with 4 additions and 4 deletions

View File

@ -80,7 +80,7 @@ QString RSGraphSource::displayName(int i) const
QString RSGraphSource::displayValue(float v) const
{
return QString::number(v,'g',2) + " " + unitName() ;
return QString::number(v,'f',2) + " " + unitName() ;
}
void RSGraphSource::getCurrentValues(std::vector<float>& vals) const

View File

@ -21,11 +21,11 @@ class TurtleGraphSource: public RSGraphSource
virtual QString displayValue(float v) const
{
if(v < 1000)
return QString::number(v,'g',2) + " B/s" ;
return QString::number(v,'f',2) + " B/s" ;
else if(v < 1000*1024)
return QString::number(v/1024.0,'g',2) + " KB/s" ;
return QString::number(v/1024.0,'f',2) + " KB/s" ;
else
return QString::number(v/(1024.0*1024),'g',2) + " MB/s" ;
return QString::number(v/(1024.0*1024),'f',2) + " MB/s" ;
}
};