Add comments re BitcoinUnits::formatWithUnit/formatHtmlWithUnit
This commit is contained in:
parent
f7d70c603f
commit
7149499fd8
@ -148,6 +148,21 @@ QString BitcoinUnits::format(int unit, qint64 n, bool fPlus, SeparatorStyle sepa
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// TODO: Review all remaining calls to BitcoinUnits::formatWithUnit to
|
||||||
|
// TODO: determine whether the output is used in a plain text context
|
||||||
|
// TODO: or an HTML context (and replace with
|
||||||
|
// TODO: BtcoinUnits::formatHtmlWithUnit in the latter case). Hopefully
|
||||||
|
// TODO: there aren't instances where the result could be used in
|
||||||
|
// TODO: either context.
|
||||||
|
|
||||||
|
// NOTE: Using formatWithUnit in an HTML context risks wrapping
|
||||||
|
// quantities at the thousands separator. More subtly, it also results
|
||||||
|
// in a standard space rather than a thin space, due to a bug in Qt's
|
||||||
|
// XML whitespace canonicalisation
|
||||||
|
//
|
||||||
|
// Please take care to use formatHtmlWithUnit instead, when
|
||||||
|
// appropriate.
|
||||||
|
|
||||||
QString BitcoinUnits::formatWithUnit(int unit, qint64 amount, bool plussign, SeparatorStyle separators)
|
QString BitcoinUnits::formatWithUnit(int unit, qint64 amount, bool plussign, SeparatorStyle separators)
|
||||||
{
|
{
|
||||||
return format(unit, amount, plussign, separators) + QString(" ") + name(unit);
|
return format(unit, amount, plussign, separators) + QString(" ") + name(unit);
|
||||||
|
Loading…
Reference in New Issue
Block a user