Browse Source

Add comments re BitcoinUnits::formatWithUnit/formatHtmlWithUnit

0.10
Roy Badami 11 years ago
parent
commit
7149499fd8
  1. 15
      src/qt/bitcoinunits.cpp

15
src/qt/bitcoinunits.cpp

@ -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…
Cancel
Save