mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-15 09:43:07 -07:00
Convert more accurately decimal numbers to text.
This commit is contained in:
parent
4d3672f894
commit
441d1d08ba
10 changed files with 39 additions and 48 deletions
|
@ -67,13 +67,13 @@ void StatsDialog::updateUI() {
|
|||
// Global ratio
|
||||
ui->labelGlobalRatio->setText(
|
||||
( atd > 0 && atu > 0 ) ?
|
||||
QString::number( (qreal)atu / (qreal)atd, 'f', 2) :
|
||||
misc::accurateDoubleToString((qreal)atu / (qreal)atd, 2) :
|
||||
"-"
|
||||
);
|
||||
// Cache hits
|
||||
ui->labelCacheHits->setText(
|
||||
( cache.blocks_read > 0 && cache.blocks_read_hit > 0 ) ?
|
||||
QString("%L1\%").arg(100. * (qreal)cache.blocks_read_hit / (qreal)cache.blocks_read, 0, 'f', 2) :
|
||||
misc::accurateDoubleToString(100. * (qreal)cache.blocks_read_hit / (qreal)cache.blocks_read, 2) :
|
||||
"-"
|
||||
);
|
||||
// Buffers size
|
||||
|
@ -91,12 +91,12 @@ void StatsDialog::updateUI() {
|
|||
peers += (*iBegin).status().num_peers;
|
||||
ui->labelWriteStarve->setText(
|
||||
( ss.disk_write_queue > 0 && peers > 0 ) ?
|
||||
QString("%L1\%").arg(100. * (qreal)ss.disk_write_queue / (qreal)peers, 0, 'f', 2) :
|
||||
misc::accurateDoubleToString(100. * (qreal)ss.disk_write_queue / (qreal)peers, 2) :
|
||||
QString("0\%")
|
||||
);
|
||||
ui->labelReadStarve->setText(
|
||||
( ss.disk_read_queue > 0 && peers > 0 ) ?
|
||||
QString("%L1\%").arg(100. * (qreal)ss.disk_read_queue / (qreal)peers, 0, 'f', 2) :
|
||||
misc::accurateDoubleToString(100. * (qreal)ss.disk_read_queue / (qreal)peers, 2) :
|
||||
QString("0\%")
|
||||
);
|
||||
// Disk queues
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue