From 08b8b287d3762dd6d4be09fad0b71c4cacfe6658 Mon Sep 17 00:00:00 2001 From: Luke Dashjr Date: Sun, 15 May 2022 21:41:31 +0000 Subject: Bugfix: GUI: Debug info: Use correct "kB" case for small mempool sizes, and make translation-friendly --- src/qt/rpcconsole.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 0e712062af..76500a4a36 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -984,10 +984,11 @@ void RPCConsole::setMempoolSize(long numberOfTxs, size_t dynUsage) { ui->mempoolNumberTxs->setText(QString::number(numberOfTxs)); - if (dynUsage < 1000000) - ui->mempoolSize->setText(QString::number(dynUsage/1000.0, 'f', 2) + " KB"); - else - ui->mempoolSize->setText(QString::number(dynUsage/1000000.0, 'f', 2) + " MB"); + if (dynUsage < 1000000) { + ui->mempoolSize->setText(QObject::tr("%1 kB").arg(dynUsage / 1000.0, 0, 'f', 2)); + } else { + ui->mempoolSize->setText(QObject::tr("%1 MB").arg(dynUsage / 1000000.0, 0, 'f', 2)); + } } void RPCConsole::on_lineEdit_returnPressed() -- cgit v1.2.3