Update darkcoin units to tDRK if TestNet().

This commit is contained in:
vertoe 2014-12-31 13:27:32 +01:00
parent bc20787fec
commit 54f54f4a67
2 changed files with 42 additions and 12 deletions

View File

@ -39,25 +39,53 @@ bool BitcoinUnits::valid(int unit)
QString BitcoinUnits::name(int unit) QString BitcoinUnits::name(int unit)
{ {
switch(unit) if(!TestNet() && !RegTest())
{ {
case DRK: return QString("DRK"); switch(unit)
case mDRK: return QString("mDRK"); {
case uDRK: return QString::fromUtf8("μDRK"); case DRK: return QString("DRK");
case duffs: return QString::fromUtf8("duffs"); case mDRK: return QString("mDRK");
default: return QString("???"); case uDRK: return QString::fromUtf8("μDRK");
case duffs: return QString::fromUtf8("duffs");
default: return QString("???");
}
}
else
{
switch(unit)
{
case DRK: return QString("tDRK");
case mDRK: return QString("mtDRK");
case uDRK: return QString::fromUtf8("μtDRK");
case duffs: return QString::fromUtf8("tduffs");
default: return QString("???");
}
} }
} }
QString BitcoinUnits::description(int unit) QString BitcoinUnits::description(int unit)
{ {
switch(unit) if(!TestNet() && !RegTest())
{ {
case DRK: return QString("Darkcoins"); switch(unit)
case mDRK: return QString("Milli-Darkcoins (1 / 1,000)"); {
case uDRK: return QString("Micro-Darkcoins (1 / 1,000,000)"); case DRK: return QString("Darkcoins");
case duffs: return QString("Ten Nano-Darkcoins (1 / 100,000,000)"); case mDRK: return QString("Milli-Darkcoins (1 / 1,000)");
default: return QString("???"); case uDRK: return QString("Micro-Darkcoins (1 / 1,000,000)");
case duffs: return QString("Ten Nano-Darkcoins (1 / 100,000,000)");
default: return QString("???");
}
}
else
{
switch(unit)
{
case DRK: return QString("Testdarkcoins");
case mDRK: return QString("Milli-Testdarkcoins (1 / 1,000)");
case uDRK: return QString("Micro-Testdarkcoins (1 / 1,000,000)");
case duffs: return QString("Ten Nano-Testdarkcoins (1 / 100,000,000)");
default: return QString("???");
}
} }
} }

View File

@ -9,6 +9,8 @@
#include <QAbstractListModel> #include <QAbstractListModel>
#include <QString> #include <QString>
#include "chainparams.h"
/** Darkcoin unit definitions. Encapsulates parsing and formatting /** Darkcoin unit definitions. Encapsulates parsing and formatting
and serves as list model for drop-down selection boxes. and serves as list model for drop-down selection boxes.
*/ */