mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-02-18 11:57:37 -05:00
[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(BTC);
|
||||||
unitlist.append(mBTC);
|
unitlist.append(mBTC);
|
||||||
unitlist.append(uBTC);
|
unitlist.append(uBTC);
|
||||||
|
unitlist.append(SAT);
|
||||||
return unitlist;
|
return unitlist;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,6 +31,7 @@ bool BitcoinUnits::valid(int unit)
|
||||||
case BTC:
|
case BTC:
|
||||||
case mBTC:
|
case mBTC:
|
||||||
case uBTC:
|
case uBTC:
|
||||||
|
case SAT:
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@ -43,6 +45,7 @@ QString BitcoinUnits::longName(int unit)
|
||||||
case BTC: return QString("BTC");
|
case BTC: return QString("BTC");
|
||||||
case mBTC: return QString("mBTC");
|
case mBTC: return QString("mBTC");
|
||||||
case uBTC: return QString::fromUtf8("µBTC (bits)");
|
case uBTC: return QString::fromUtf8("µBTC (bits)");
|
||||||
|
case SAT: return QString("Satoshi (sat)");
|
||||||
default: return QString("???");
|
default: return QString("???");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -52,6 +55,7 @@ QString BitcoinUnits::shortName(int unit)
|
||||||
switch(unit)
|
switch(unit)
|
||||||
{
|
{
|
||||||
case uBTC: return QString::fromUtf8("bits");
|
case uBTC: return QString::fromUtf8("bits");
|
||||||
|
case SAT: return QString("sat");
|
||||||
default: return longName(unit);
|
default: return longName(unit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -63,6 +67,7 @@ QString BitcoinUnits::description(int unit)
|
||||||
case BTC: return QString("Bitcoins");
|
case BTC: return QString("Bitcoins");
|
||||||
case mBTC: return QString("Milli-Bitcoins (1 / 1" THIN_SP_UTF8 "000)");
|
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 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("???");
|
default: return QString("???");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -74,6 +79,7 @@ qint64 BitcoinUnits::factor(int unit)
|
||||||
case BTC: return 100000000;
|
case BTC: return 100000000;
|
||||||
case mBTC: return 100000;
|
case mBTC: return 100000;
|
||||||
case uBTC: return 100;
|
case uBTC: return 100;
|
||||||
|
case SAT: return 1;
|
||||||
default: return 100000000;
|
default: return 100000000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -85,6 +91,7 @@ int BitcoinUnits::decimals(int unit)
|
||||||
case BTC: return 8;
|
case BTC: return 8;
|
||||||
case mBTC: return 5;
|
case mBTC: return 5;
|
||||||
case uBTC: return 2;
|
case uBTC: return 2;
|
||||||
|
case SAT: return 0;
|
||||||
default: return 0;
|
default: return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,8 @@ public:
|
||||||
{
|
{
|
||||||
BTC,
|
BTC,
|
||||||
mBTC,
|
mBTC,
|
||||||
uBTC
|
uBTC,
|
||||||
|
SAT
|
||||||
};
|
};
|
||||||
|
|
||||||
enum SeparatorStyle
|
enum SeparatorStyle
|
||||||
|
|
Loading…
Add table
Reference in a new issue