aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoinunits.cpp
diff options
context:
space:
mode:
authorWilliam Casarin <jb55@jb55.com>2017-12-27 08:01:45 -0800
committerWilliam Casarin <jb55@jb55.com>2017-12-28 09:54:58 -0800
commit275b2eeed4050d8797bf127e5abf171c050e182a (patch)
tree0ee7df1cc8c5f470a25dd1171a0863bf6128dbfc /src/qt/bitcoinunits.cpp
parent5180a86c96bc05d2a731f70f36aae28ab5a3fad4 (diff)
[qt] change µBTC to bits
* Now that we have bip176, change "µBTC" to the more colloquial "bits" * We retain the `µBTC (bits)` description in dropdowns and status bars. The more concise "bits" is used when appended to numbers. Signed-off-by: William Casarin <jb55@jb55.com>
Diffstat (limited to 'src/qt/bitcoinunits.cpp')
-rw-r--r--src/qt/bitcoinunits.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp
index c8614fdfe0..250ef544c7 100644
--- a/src/qt/bitcoinunits.cpp
+++ b/src/qt/bitcoinunits.cpp
@@ -36,24 +36,33 @@ bool BitcoinUnits::valid(int unit)
}
}
-QString BitcoinUnits::name(int unit)
+QString BitcoinUnits::longName(int unit)
{
switch(unit)
{
case BTC: return QString("BTC");
case mBTC: return QString("mBTC");
- case uBTC: return QString::fromUtf8("μBTC");
+ case uBTC: return QString::fromUtf8("µBTC (bits)");
default: return QString("???");
}
}
+QString BitcoinUnits::shortName(int unit)
+{
+ switch(unit)
+ {
+ case uBTC: return QString::fromUtf8("bits");
+ default: return longName(unit);
+ }
+}
+
QString BitcoinUnits::description(int unit)
{
switch(unit)
{
case BTC: return QString("Bitcoins");
case mBTC: return QString("Milli-Bitcoins (1 / 1" THIN_SP_UTF8 "000)");
- case uBTC: return QString("Micro-Bitcoins (1 / 1" THIN_SP_UTF8 "000" THIN_SP_UTF8 "000)");
+ case uBTC: return QString("Micro-Bitcoins (bits) (1 / 1" THIN_SP_UTF8 "000" THIN_SP_UTF8 "000)");
default: return QString("???");
}
}
@@ -121,7 +130,7 @@ QString BitcoinUnits::format(int unit, const CAmount& nIn, bool fPlus, Separator
QString BitcoinUnits::formatWithUnit(int unit, const CAmount& amount, bool plussign, SeparatorStyle separators)
{
- return format(unit, amount, plussign, separators) + QString(" ") + name(unit);
+ return format(unit, amount, plussign, separators) + QString(" ") + shortName(unit);
}
QString BitcoinUnits::formatHtmlWithUnit(int unit, const CAmount& amount, bool plussign, SeparatorStyle separators)
@@ -176,7 +185,7 @@ QString BitcoinUnits::getAmountColumnTitle(int unit)
QString amountTitle = QObject::tr("Amount");
if (BitcoinUnits::valid(unit))
{
- amountTitle += " ("+BitcoinUnits::name(unit) + ")";
+ amountTitle += " ("+BitcoinUnits::shortName(unit) + ")";
}
return amountTitle;
}
@@ -197,7 +206,7 @@ QVariant BitcoinUnits::data(const QModelIndex &index, int role) const
{
case Qt::EditRole:
case Qt::DisplayRole:
- return QVariant(name(unit));
+ return QVariant(longName(unit));
case Qt::ToolTipRole:
return QVariant(description(unit));
case UnitRole: