aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Lodder <[email protected]>2015-10-17 11:51:19 +0200
committerJ Ross Nicoll <[email protected]>2015-10-31 14:49:41 +0000
commite1973941ae2c8a363c6ac637558afb2694af0ad8 (patch)
treeef666c794670ed439873568dde12cf0faf46aa90
parentAdd minimum constraint on custom fees field (diff)
downloaddiscoin-e1973941ae2c8a363c6ac637558afb2694af0ad8.tar.xz
discoin-e1973941ae2c8a363c6ac637558afb2694af0ad8.zip
[Qt] Disable milli and micro units, introduce kilo and mega units
milli- and micro-Dogecoins are below dust threshold so do not make any sense as display units. Instead, kilo- and mega-dogecoins are probably more useful, as those make common amounts easier to read instead of harder
-rw-r--r--src/qt/bitcoinunits.cpp20
-rw-r--r--src/qt/bitcoinunits.h2
2 files changed, 19 insertions, 3 deletions
diff --git a/src/qt/bitcoinunits.cpp b/src/qt/bitcoinunits.cpp
index a4430c4ce..5e02329d4 100644
--- a/src/qt/bitcoinunits.cpp
+++ b/src/qt/bitcoinunits.cpp
@@ -19,8 +19,10 @@ QList<BitcoinUnits::Unit> BitcoinUnits::availableUnits()
{
QList<BitcoinUnits::Unit> unitlist;
unitlist.append(BTC);
- unitlist.append(mBTC);
- unitlist.append(uBTC);
+ unitlist.append(kBTC);
+ unitlist.append(MBTC);
+ //unitlist.append(mBTC);
+ //unitlist.append(uBTC);
return unitlist;
}
@@ -28,10 +30,12 @@ bool BitcoinUnits::valid(int unit)
{
switch(unit)
{
+ case MBTC:
+ case kBTC:
case BTC:
+ return true;
case mBTC:
case uBTC:
- return true;
default:
return false;
}
@@ -41,6 +45,8 @@ QString BitcoinUnits::name(int unit)
{
switch(unit)
{
+ case MBTC: return QString("MDOGE");
+ case kBTC: return QString("kDOGE");
case BTC: return QString("DOGE");
case mBTC: return QString("mDOGE");
case uBTC: return QChar(0x03BC) + QString("DOGE");
@@ -52,6 +58,8 @@ QString BitcoinUnits::description(int unit)
{
switch(unit)
{
+ case MBTC: return tr("Mega-Dogecoins (1,000,000)");
+ case kBTC: return tr("Kilo-Dogecoins (1,000)");
case BTC: return tr("Dogecoins");
case mBTC: return tr("Milli-Dogecoins (1 / 1,000)");
case uBTC: return tr("Micro-Dogecoins (1 / 1,000,000)");
@@ -63,6 +71,8 @@ qint64 BitcoinUnits::factor(int unit)
{
switch(unit)
{
+ case MBTC: return 100000000000000;
+ case kBTC: return 100000000000;
case BTC: return 100000000;
case mBTC: return 100000;
case uBTC: return 100;
@@ -74,6 +84,8 @@ qint64 BitcoinUnits::maxAmount(int unit)
{
switch(unit)
{
+ case MBTC: return Q_INT64_C(900000);
+ case kBTC: return Q_INT64_C(900000000);
case BTC: return Q_INT64_C(900000000000); //less than the coin supply until the year 2170
case mBTC: return Q_INT64_C(900000000000000);
case uBTC: return Q_INT64_C(900000000000000000); // Slightly under max value for int64
@@ -85,6 +97,8 @@ int BitcoinUnits::decimals(int unit)
{
switch(unit)
{
+ case MBTC: return 14;
+ case kBTC: return 11;
case BTC: return 8;
case mBTC: return 5;
case uBTC: return 2;
diff --git a/src/qt/bitcoinunits.h b/src/qt/bitcoinunits.h
index afc066aac..fdffc617a 100644
--- a/src/qt/bitcoinunits.h
+++ b/src/qt/bitcoinunits.h
@@ -57,6 +57,8 @@ public:
*/
enum Unit
{
+ MBTC,
+ kBTC,
BTC,
mBTC,
uBTC