[qt] Added satoshi unit
"Satoshi (sat)" will be displayed in dropdowns and status bars. "sat" will be used when appended to numbers.
This commit is contained in:
parent
4ddbcbf8c4
commit
c722f00a7e
2 changed files with 12 additions and 4 deletions
|
@ -20,6 +20,7 @@ QList<BitcoinUnits::Unit> BitcoinUnits::availableUnits()
|
|||
unitlist.append(BTC);
|
||||
unitlist.append(mBTC);
|
||||
unitlist.append(uBTC);
|
||||
unitlist.append(SAT);
|
||||
return unitlist;
|
||||
}
|
||||
|
||||
|
@ -30,6 +31,7 @@ bool BitcoinUnits::valid(int unit)
|
|||
case BTC:
|
||||
case mBTC:
|
||||
case uBTC:
|
||||
case SAT:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
|
@ -43,6 +45,7 @@ QString BitcoinUnits::longName(int unit)
|
|||
case BTC: return QString("BTC");
|
||||
case mBTC: return QString("mBTC");
|
||||
case uBTC: return QString::fromUtf8("µBTC (bits)");
|
||||
case SAT: return QString("Satoshi (sat)");
|
||||
default: return QString("???");
|
||||
}
|
||||
}
|
||||
|
@ -52,7 +55,8 @@ QString BitcoinUnits::shortName(int unit)
|
|||
switch(unit)
|
||||
{
|
||||
case uBTC: return QString::fromUtf8("bits");
|
||||
default: return longName(unit);
|
||||
case SAT: return QString("sat");
|
||||
default: return longName(unit);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -63,6 +67,7 @@ QString BitcoinUnits::description(int unit)
|
|||
case BTC: return QString("Bitcoins");
|
||||
case mBTC: return QString("Milli-Bitcoins (1 / 1" THIN_SP_UTF8 "000)");
|
||||
case uBTC: return QString("Micro-Bitcoins (bits) (1 / 1" THIN_SP_UTF8 "000" THIN_SP_UTF8 "000)");
|
||||
case SAT: return QString("Satoshi (sat) (1 / 100" THIN_SP_UTF8 "000" THIN_SP_UTF8 "000)");
|
||||
default: return QString("???");
|
||||
}
|
||||
}
|
||||
|
@ -71,10 +76,11 @@ qint64 BitcoinUnits::factor(int unit)
|
|||
{
|
||||
switch(unit)
|
||||
{
|
||||
case BTC: return 100000000;
|
||||
case BTC: return 100000000;
|
||||
case mBTC: return 100000;
|
||||
case uBTC: return 100;
|
||||
default: return 100000000;
|
||||
case SAT: return 1;
|
||||
default: return 100000000;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -85,6 +91,7 @@ int BitcoinUnits::decimals(int unit)
|
|||
case BTC: return 8;
|
||||
case mBTC: return 5;
|
||||
case uBTC: return 2;
|
||||
case SAT: return 0;
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -58,7 +58,8 @@ public:
|
|||
{
|
||||
BTC,
|
||||
mBTC,
|
||||
uBTC
|
||||
uBTC,
|
||||
SAT
|
||||
};
|
||||
|
||||
enum SeparatorStyle
|
||||
|
|
Loading…
Add table
Reference in a new issue