mirror of
https://github.com/qbittorrent/qBittorrent
synced 2025-07-07 13:41:26 -07:00
Avoid potential rounding to integer issues
This commit is contained in:
parent
4381739b6d
commit
75cead9266
2 changed files with 6 additions and 10 deletions
|
@ -316,12 +316,11 @@ QString TransferListModel::displayValue(const BitTorrent::TorrentHandle *torrent
|
|||
return tagsList.join(", ");
|
||||
};
|
||||
|
||||
const auto progressString = [](qreal progress) -> QString
|
||||
const auto progressString = [](const qreal progress) -> QString
|
||||
{
|
||||
progress *= 100;
|
||||
return (static_cast<int>(progress) == 100)
|
||||
return (progress >= 1)
|
||||
? QString::fromLatin1("100%")
|
||||
: Utils::String::fromDouble(progress, 1) + '%';
|
||||
: Utils::String::fromDouble((progress * 100), 1) + QLatin1Char('%');
|
||||
};
|
||||
|
||||
const auto statusString = [this](const BitTorrent::TorrentState state, const QString &errorMessage) -> QString
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue