Skip to content

Commit 40d2d69

Browse files
committed
Merge pull request #4167
7149499 Add comments re BitcoinUnits::formatWithUnit/formatHtmlWithUnit (Roy Badami) f7d70c6 Remove unused fAlign argument from BitcoinUnits::format and friends (Roy Badami) 2e4fee2 Show bitcoin quantities with full precision, even in the presence of trailing zeros (Roy Badami) 7007402 Implement SI-style (thin space) thoudands separator (Roy Badami)
2 parents 5bb7655 + 7149499 commit 40d2d69

10 files changed

+202
-47
lines changed

src/qt/bitcoinamountfield.cpp

Lines changed: 47 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,59 @@
1414
#include <QKeyEvent>
1515
#include <qmath.h> // for qPow()
1616

17+
// QDoubleSpinBox that shows SI-style thin space thousands separators
18+
class AmountSpinBox: public QDoubleSpinBox
19+
{
20+
public:
21+
explicit AmountSpinBox(QWidget *parent):
22+
QDoubleSpinBox(parent)
23+
{
24+
}
25+
QString textFromValue(double value) const
26+
{
27+
QStringList parts = QDoubleSpinBox::textFromValue(value).split(".");
28+
QString quotient_str = parts[0];
29+
QString remainder_str;
30+
if(parts.size() > 1)
31+
remainder_str = parts[1];
32+
33+
// Code duplication between here and BitcoinUnits::format
34+
// TODO: Figure out how to share this code
35+
QChar thin_sp(THIN_SP_CP);
36+
int q_size = quotient_str.size();
37+
if (q_size > 4)
38+
for (int i = 3; i < q_size; i += 3)
39+
quotient_str.insert(q_size - i, thin_sp);
40+
41+
int r_size = remainder_str.size();
42+
if (r_size > 4)
43+
for (int i = 3, adj = 0; i < r_size; i += 3, adj++)
44+
remainder_str.insert(i + adj, thin_sp);
45+
46+
if(remainder_str.isEmpty())
47+
return quotient_str;
48+
else
49+
return quotient_str + QString(".") + remainder_str;
50+
}
51+
QValidator::State validate (QString &text, int &pos) const
52+
{
53+
QString s(BitcoinUnits::removeSpaces(text));
54+
return QDoubleSpinBox::validate(s, pos);
55+
}
56+
double valueFromText(const QString& text) const
57+
{
58+
return QDoubleSpinBox::valueFromText(BitcoinUnits::removeSpaces(text));
59+
}
60+
};
61+
1762
BitcoinAmountField::BitcoinAmountField(QWidget *parent) :
1863
QWidget(parent),
1964
amount(0),
2065
currentUnit(-1)
2166
{
2267
nSingleStep = 100000; // satoshis
2368

24-
amount = new QDoubleSpinBox(this);
69+
amount = new AmountSpinBox(this);
2570
amount->setLocale(QLocale::c());
2671
amount->installEventFilter(this);
2772
amount->setMaximumWidth(170);
@@ -52,7 +97,7 @@ void BitcoinAmountField::setText(const QString &text)
5297
if (text.isEmpty())
5398
amount->clear();
5499
else
55-
amount->setValue(text.toDouble());
100+
amount->setValue(BitcoinUnits::removeSpaces(text).toDouble());
56101
}
57102

58103
void BitcoinAmountField::clear()

src/qt/bitcoinunits.cpp

Lines changed: 46 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ QString BitcoinUnits::description(int unit)
6161
switch(unit)
6262
{
6363
case BTC: return QString("Bitcoins");
64-
case mBTC: return QString("Milli-Bitcoins (1 / 1,000)");
65-
case uBTC: return QString("Micro-Bitcoins (1 / 1,000,000)");
64+
case mBTC: return QString("Milli-Bitcoins (1 / 1" THIN_SP_UTF8 "000)");
65+
case uBTC: return QString("Micro-Bitcoins (1 / 1" THIN_SP_UTF8 "000" THIN_SP_UTF8 "000)");
6666
default: return QString("???");
6767
}
6868
}
@@ -111,7 +111,7 @@ int BitcoinUnits::decimals(int unit)
111111
}
112112
}
113113

114-
QString BitcoinUnits::format(int unit, qint64 n, bool fPlus)
114+
QString BitcoinUnits::format(int unit, qint64 n, bool fPlus, SeparatorStyle separators)
115115
{
116116
// Note: not using straight sprintf here because we do NOT want
117117
// localized number formatting.
@@ -125,11 +125,20 @@ QString BitcoinUnits::format(int unit, qint64 n, bool fPlus)
125125
QString quotient_str = QString::number(quotient);
126126
QString remainder_str = QString::number(remainder).rightJustified(num_decimals, '0');
127127

128-
// Right-trim excess zeros after the decimal point
129-
int nTrim = 0;
130-
for (int i = remainder_str.size()-1; i>=2 && (remainder_str.at(i) == '0'); --i)
131-
++nTrim;
132-
remainder_str.chop(nTrim);
128+
// Use SI-stule separators as these are locale indendent and can't be
129+
// confused with the decimal marker. Rule is to use a thin space every
130+
// three digits on *both* sides of the decimal point - but only if there
131+
// are five or more digits
132+
QChar thin_sp(THIN_SP_CP);
133+
int q_size = quotient_str.size();
134+
if (separators == separatorAlways || (separators == separatorStandard && q_size > 4))
135+
for (int i = 3; i < q_size; i += 3)
136+
quotient_str.insert(q_size - i, thin_sp);
137+
138+
int r_size = remainder_str.size();
139+
if (separators == separatorAlways || (separators == separatorStandard && r_size > 4))
140+
for (int i = 3, adj = 0; i < r_size ; i += 3, adj++)
141+
remainder_str.insert(i + adj, thin_sp);
133142

134143
if (n < 0)
135144
quotient_str.insert(0, '-');
@@ -138,17 +147,43 @@ QString BitcoinUnits::format(int unit, qint64 n, bool fPlus)
138147
return quotient_str + QString(".") + remainder_str;
139148
}
140149

141-
QString BitcoinUnits::formatWithUnit(int unit, qint64 amount, bool plussign)
150+
151+
// TODO: Review all remaining calls to BitcoinUnits::formatWithUnit to
152+
// TODO: determine whether the output is used in a plain text context
153+
// TODO: or an HTML context (and replace with
154+
// TODO: BtcoinUnits::formatHtmlWithUnit in the latter case). Hopefully
155+
// TODO: there aren't instances where the result could be used in
156+
// TODO: either context.
157+
158+
// NOTE: Using formatWithUnit in an HTML context risks wrapping
159+
// quantities at the thousands separator. More subtly, it also results
160+
// in a standard space rather than a thin space, due to a bug in Qt's
161+
// XML whitespace canonicalisation
162+
//
163+
// Please take care to use formatHtmlWithUnit instead, when
164+
// appropriate.
165+
166+
QString BitcoinUnits::formatWithUnit(int unit, qint64 amount, bool plussign, SeparatorStyle separators)
167+
{
168+
return format(unit, amount, plussign, separators) + QString(" ") + name(unit);
169+
}
170+
171+
QString BitcoinUnits::formatHtmlWithUnit(int unit, qint64 amount, bool plussign, SeparatorStyle separators)
142172
{
143-
return format(unit, amount, plussign) + QString(" ") + name(unit);
173+
QString str(formatWithUnit(unit, amount, plussign, separators));
174+
str.replace(QChar(THIN_SP_CP), QString(THIN_SP_HTML));
175+
return QString("<span style='white-space: nowrap;'>%1</span>").arg(str);
144176
}
145177

178+
146179
bool BitcoinUnits::parse(int unit, const QString &value, qint64 *val_out)
147180
{
148181
if(!valid(unit) || value.isEmpty())
149182
return false; // Refuse to parse invalid unit or empty string
150183
int num_decimals = decimals(unit);
151-
QStringList parts = value.split(".");
184+
185+
// Ignore spaces and thin spaces when parsing
186+
QStringList parts = removeSpaces(value).split(".");
152187

153188
if(parts.size() > 2)
154189
{

src/qt/bitcoinunits.h

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,37 @@
88
#include <QAbstractListModel>
99
#include <QString>
1010

11+
// U+2009 THIN SPACE = UTF-8 E2 80 89
12+
#define REAL_THIN_SP_CP 0x2009
13+
#define REAL_THIN_SP_UTF8 "\xE2\x80\x89"
14+
#define REAL_THIN_SP_HTML "&thinsp;"
15+
16+
// U+200A HAIR SPACE = UTF-8 E2 80 8A
17+
#define HAIR_SP_CP 0x200A
18+
#define HAIR_SP_UTF8 "\xE2\x80\x8A"
19+
#define HAIR_SP_HTML "&#8202;"
20+
21+
// U+2006 SIX-PER-EM SPACE = UTF-8 E2 80 86
22+
#define SIXPEREM_SP_CP 0x2006
23+
#define SIXPEREM_SP_UTF8 "\xE2\x80\x86"
24+
#define SIXPEREM_SP_HTML "&#8198;"
25+
26+
// U+2007 FIGURE SPACE = UTF-8 E2 80 87
27+
#define FIGURE_SP_CP 0x2007
28+
#define FIGURE_SP_UTF8 "\xE2\x80\x87"
29+
#define FIGURE_SP_HTML "&#8199;"
30+
31+
// QMessageBox seems to have a bug whereby it doesn't display thin/hair spaces
32+
// correctly. Workaround is to display a space in a small font. If you
33+
// change this, please test that it doesn't cause the parent span to start
34+
// wrapping.
35+
#define HTML_HACK_SP "<span style='white-space: nowrap; font-size: 6pt'> </span>"
36+
37+
// Define THIN_SP_* variables to be our preferred type of thin space
38+
#define THIN_SP_CP REAL_THIN_SP_CP
39+
#define THIN_SP_UTF8 REAL_THIN_SP_UTF8
40+
#define THIN_SP_HTML HTML_HACK_SP
41+
1142
/** Bitcoin unit definitions. Encapsulates parsing and formatting
1243
and serves as list model for drop-down selection boxes.
1344
*/
@@ -28,6 +59,13 @@ class BitcoinUnits: public QAbstractListModel
2859
uBTC
2960
};
3061

62+
enum SeparatorStyle
63+
{
64+
separatorNever,
65+
separatorStandard,
66+
separatorAlways
67+
};
68+
3169
//! @name Static API
3270
//! Unit conversion and formatting
3371
///@{
@@ -51,9 +89,10 @@ class BitcoinUnits: public QAbstractListModel
5189
//! Number of decimals left
5290
static int decimals(int unit);
5391
//! Format as string
54-
static QString format(int unit, qint64 amount, bool plussign=false);
92+
static QString format(int unit, qint64 amount, bool plussign=false, SeparatorStyle separators=separatorStandard);
5593
//! Format as string (with unit)
56-
static QString formatWithUnit(int unit, qint64 amount, bool plussign=false);
94+
static QString formatWithUnit(int unit, qint64 amount, bool plussign=false, SeparatorStyle separators=separatorStandard);
95+
static QString formatHtmlWithUnit(int unit, qint64 amount, bool plussign=false, SeparatorStyle separators=separatorStandard);
5796
//! Parse string to coin amount
5897
static bool parse(int unit, const QString &value, qint64 *val_out);
5998
//! Gets title for amount column including current display unit if optionsModel reference available */
@@ -71,6 +110,16 @@ class BitcoinUnits: public QAbstractListModel
71110
QVariant data(const QModelIndex &index, int role) const;
72111
///@}
73112

113+
static QString removeSpaces(QString text)
114+
{
115+
text.remove(' ');
116+
text.remove(QChar(THIN_SP_CP));
117+
#if (THIN_SP_CP != REAL_THIN_SP_CP)
118+
text.remove(QChar(REAL_THIN_SP_CP));
119+
#endif
120+
return text;
121+
}
122+
74123
private:
75124
QList<BitcoinUnits::Unit> unitlist;
76125
};

src/qt/overviewpage.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ class TxViewDelegate : public QAbstractItemDelegate
7272
foreground = option.palette.color(QPalette::Text);
7373
}
7474
painter->setPen(foreground);
75-
QString amountText = BitcoinUnits::formatWithUnit(unit, amount, true);
75+
QString amountText = BitcoinUnits::formatWithUnit(unit, amount, true, BitcoinUnits::separatorAlways);
7676
if(!confirmed)
7777
{
7878
amountText = QString("[") + amountText + QString("]");
@@ -147,14 +147,14 @@ void OverviewPage::setBalance(qint64 balance, qint64 unconfirmedBalance, qint64
147147
currentWatchOnlyBalance = watchOnlyBalance;
148148
currentWatchUnconfBalance = watchUnconfBalance;
149149
currentWatchImmatureBalance = watchImmatureBalance;
150-
ui->labelBalance->setText(BitcoinUnits::formatWithUnit(unit, balance));
151-
ui->labelUnconfirmed->setText(BitcoinUnits::formatWithUnit(unit, unconfirmedBalance));
152-
ui->labelImmature->setText(BitcoinUnits::formatWithUnit(unit, immatureBalance));
153-
ui->labelTotal->setText(BitcoinUnits::formatWithUnit(unit, balance + unconfirmedBalance + immatureBalance));
154-
ui->labelWatchAvailable->setText(BitcoinUnits::formatWithUnit(unit, watchOnlyBalance));
155-
ui->labelWatchPending->setText(BitcoinUnits::formatWithUnit(unit, watchUnconfBalance));
156-
ui->labelWatchImmature->setText(BitcoinUnits::formatWithUnit(unit, watchImmatureBalance));
157-
ui->labelWatchTotal->setText(BitcoinUnits::formatWithUnit(unit, watchOnlyBalance + watchUnconfBalance + watchImmatureBalance));
150+
ui->labelBalance->setText(BitcoinUnits::formatWithUnit(unit, balance, false, BitcoinUnits::separatorAlways));
151+
ui->labelUnconfirmed->setText(BitcoinUnits::formatWithUnit(unit, unconfirmedBalance, false, BitcoinUnits::separatorAlways));
152+
ui->labelImmature->setText(BitcoinUnits::formatWithUnit(unit, immatureBalance, false, BitcoinUnits::separatorAlways));
153+
ui->labelTotal->setText(BitcoinUnits::formatWithUnit(unit, balance + unconfirmedBalance + immatureBalance, false, BitcoinUnits::separatorAlways));
154+
ui->labelWatchAvailable->setText(BitcoinUnits::formatWithUnit(unit, watchOnlyBalance, false, BitcoinUnits::separatorAlways));
155+
ui->labelWatchPending->setText(BitcoinUnits::formatWithUnit(unit, watchUnconfBalance, false, BitcoinUnits::separatorAlways));
156+
ui->labelWatchImmature->setText(BitcoinUnits::formatWithUnit(unit, watchImmatureBalance, false, BitcoinUnits::separatorAlways));
157+
ui->labelWatchTotal->setText(BitcoinUnits::formatWithUnit(unit, watchOnlyBalance + watchUnconfBalance + watchImmatureBalance, false, BitcoinUnits::separatorAlways));
158158

159159
// only show immature (newly mined) balance if it's non-zero, so as not to complicate things
160160
// for the non-mining users

src/qt/sendcoinsdialog.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ void SendCoinsDialog::on_sendButton_clicked()
143143
foreach(const SendCoinsRecipient &rcp, recipients)
144144
{
145145
// generate bold amount string
146-
QString amount = "<b>" + BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), rcp.amount);
146+
QString amount = "<b>" + BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), rcp.amount);
147147
amount.append("</b>");
148148
// generate monospace address string
149149
QString address = "<span style='font-family: monospace;'>" + rcp.address;
@@ -211,7 +211,7 @@ void SendCoinsDialog::on_sendButton_clicked()
211211
{
212212
// append fee string if a fee is required
213213
questionString.append("<hr /><span style='color:#aa0000;'>");
214-
questionString.append(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee));
214+
questionString.append(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), txFee));
215215
questionString.append("</span> ");
216216
questionString.append(tr("added as transaction fee"));
217217
}
@@ -223,10 +223,10 @@ void SendCoinsDialog::on_sendButton_clicked()
223223
foreach(BitcoinUnits::Unit u, BitcoinUnits::availableUnits())
224224
{
225225
if(u != model->getOptionsModel()->getDisplayUnit())
226-
alternativeUnits.append(BitcoinUnits::formatWithUnit(u, totalAmount));
226+
alternativeUnits.append(BitcoinUnits::formatHtmlWithUnit(u, totalAmount));
227227
}
228228
questionString.append(tr("Total Amount %1 (= %2)")
229-
.arg(BitcoinUnits::formatWithUnit(model->getOptionsModel()->getDisplayUnit(), totalAmount))
229+
.arg(BitcoinUnits::formatHtmlWithUnit(model->getOptionsModel()->getDisplayUnit(), totalAmount))
230230
.arg(alternativeUnits.join(" " + tr("or") + " ")));
231231

232232
QMessageBox::StandardButton retval = QMessageBox::question(this, tr("Confirm send coins"),

src/qt/transactiondesc.cpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco
136136
nUnmatured += wallet->GetCredit(txout, ISMINE_ALL);
137137
strHTML += "<b>" + tr("Credit") + ":</b> ";
138138
if (wtx.IsInMainChain())
139-
strHTML += BitcoinUnits::formatWithUnit(unit, nUnmatured)+ " (" + tr("matures in %n more block(s)", "", wtx.GetBlocksToMaturity()) + ")";
139+
strHTML += BitcoinUnits::formatHtmlWithUnit(unit, nUnmatured)+ " (" + tr("matures in %n more block(s)", "", wtx.GetBlocksToMaturity()) + ")";
140140
else
141141
strHTML += "(" + tr("not accepted") + ")";
142142
strHTML += "<br>";
@@ -146,7 +146,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco
146146
//
147147
// Credit
148148
//
149-
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, nNet) + "<br>";
149+
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatHtmlWithUnit(unit, nNet) + "<br>";
150150
}
151151
else
152152
{
@@ -197,23 +197,23 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco
197197
}
198198
}
199199

200-
strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, -txout.nValue) + "<br>";
200+
strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatHtmlWithUnit(unit, -txout.nValue) + "<br>";
201201
if(toSelf)
202-
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, txout.nValue) + "<br>";
202+
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatHtmlWithUnit(unit, txout.nValue) + "<br>";
203203
}
204204

205205
if (fAllToMe)
206206
{
207207
// Payment to self
208208
int64_t nChange = wtx.GetChange();
209209
int64_t nValue = nCredit - nChange;
210-
strHTML += "<b>" + tr("Total debit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, -nValue) + "<br>";
211-
strHTML += "<b>" + tr("Total credit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, nValue) + "<br>";
210+
strHTML += "<b>" + tr("Total debit") + ":</b> " + BitcoinUnits::formatHtmlWithUnit(unit, -nValue) + "<br>";
211+
strHTML += "<b>" + tr("Total credit") + ":</b> " + BitcoinUnits::formatHtmlWithUnit(unit, nValue) + "<br>";
212212
}
213213

214214
int64_t nTxFee = nDebit - wtx.GetValueOut();
215215
if (nTxFee > 0)
216-
strHTML += "<b>" + tr("Transaction fee") + ":</b> " + BitcoinUnits::formatWithUnit(unit, -nTxFee) + "<br>";
216+
strHTML += "<b>" + tr("Transaction fee") + ":</b> " + BitcoinUnits::formatHtmlWithUnit(unit, -nTxFee) + "<br>";
217217
}
218218
else
219219
{
@@ -222,14 +222,14 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco
222222
//
223223
BOOST_FOREACH(const CTxIn& txin, wtx.vin)
224224
if (wallet->IsMine(txin))
225-
strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, -wallet->GetDebit(txin, ISMINE_ALL)) + "<br>";
225+
strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatHtmlWithUnit(unit, -wallet->GetDebit(txin, ISMINE_ALL)) + "<br>";
226226
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
227227
if (wallet->IsMine(txout))
228-
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, wallet->GetCredit(txout, ISMINE_ALL)) + "<br>";
228+
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatHtmlWithUnit(unit, wallet->GetCredit(txout, ISMINE_ALL)) + "<br>";
229229
}
230230
}
231231

232-
strHTML += "<b>" + tr("Net amount") + ":</b> " + BitcoinUnits::formatWithUnit(unit, nNet, true) + "<br>";
232+
strHTML += "<b>" + tr("Net amount") + ":</b> " + BitcoinUnits::formatHtmlWithUnit(unit, nNet, true) + "<br>";
233233

234234
//
235235
// Message
@@ -275,10 +275,10 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco
275275
strHTML += "<hr><br>" + tr("Debug information") + "<br><br>";
276276
BOOST_FOREACH(const CTxIn& txin, wtx.vin)
277277
if(wallet->IsMine(txin))
278-
strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, -wallet->GetDebit(txin, ISMINE_ALL)) + "<br>";
278+
strHTML += "<b>" + tr("Debit") + ":</b> " + BitcoinUnits::formatHtmlWithUnit(unit, -wallet->GetDebit(txin, ISMINE_ALL)) + "<br>";
279279
BOOST_FOREACH(const CTxOut& txout, wtx.vout)
280280
if(wallet->IsMine(txout))
281-
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatWithUnit(unit, wallet->GetCredit(txout, ISMINE_ALL)) + "<br>";
281+
strHTML += "<b>" + tr("Credit") + ":</b> " + BitcoinUnits::formatHtmlWithUnit(unit, wallet->GetCredit(txout, ISMINE_ALL)) + "<br>";
282282

283283
strHTML += "<br><b>" + tr("Transaction") + ":</b><br>";
284284
strHTML += GUIUtil::HtmlEscape(wtx.ToString(), true);
@@ -304,7 +304,7 @@ QString TransactionDesc::toHTML(CWallet *wallet, CWalletTx &wtx, TransactionReco
304304
strHTML += GUIUtil::HtmlEscape(wallet->mapAddressBook[address].name) + " ";
305305
strHTML += QString::fromStdString(CBitcoinAddress(address).ToString());
306306
}
307-
strHTML = strHTML + " " + tr("Amount") + "=" + BitcoinUnits::formatWithUnit(unit, vout.nValue);
307+
strHTML = strHTML + " " + tr("Amount") + "=" + BitcoinUnits::formatHtmlWithUnit(unit, vout.nValue);
308308
strHTML = strHTML + " IsMine=" + (wallet->IsMine(vout) & ISMINE_SPENDABLE ? tr("true") : tr("false")) + "</li>";
309309
strHTML = strHTML + " IsWatchOnly=" + (wallet->IsMine(vout) & ISMINE_WATCH_ONLY ? tr("true") : tr("false")) + "</li>";
310310
}

0 commit comments

Comments
 (0)