 |
Bitcoin Core
21.99.0
P2P Digital Currency
|
Go to the documentation of this file.
5 #ifndef BITCOIN_QT_BITCOINUNITS_H
6 #define BITCOIN_QT_BITCOINUNITS_H
10 #include <QAbstractListModel>
14 #define REAL_THIN_SP_CP 0x2009
15 #define REAL_THIN_SP_UTF8 "\xE2\x80\x89"
21 #define HTML_HACK_SP "<span style='white-space: nowrap; font-size: 6pt'> </span>"
24 #define THIN_SP_CP REAL_THIN_SP_CP
25 #define THIN_SP_UTF8 REAL_THIN_SP_UTF8
26 #define THIN_SP_HTML HTML_HACK_SP
63 static bool valid(
int unit);
71 static qint64
factor(
int unit);
83 static bool parse(
int unit,
const QString &value,
CAmount *val_out);
95 int rowCount(
const QModelIndex &parent)
const override;
96 QVariant
data(
const QModelIndex &index,
int role)
const override;
114 #endif // BITCOIN_QT_BITCOINUNITS_H
static int decimals(int unit)
Number of decimals left.
static QString formatWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD)
Format as string (with unit)
static CAmount maxMoney()
Return maximum number of base units (Satoshis)
static QString formatHtmlWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD)
Format as HTML string (with unit)
static qint64 factor(int unit)
Number of Satoshis (1e-8) per unit.
static bool parse(int unit, const QString &value, CAmount *val_out)
Parse string to coin amount.
static bool valid(int unit)
Is unit ID valid?
static QString description(int unit)
Longer description.
static QString removeSpaces(QString text)
static QList< Unit > availableUnits()
Get list of units, for drop-down box.
QList< BitcoinUnits::Unit > unitlist
BitcoinUnits::Unit BitcoinUnit
Bitcoin unit definitions.
int64_t CAmount
Amount in satoshis (Can be negative)
static QString longName(int unit)
Long name.
int rowCount(const QModelIndex &parent) const override
QVariant data(const QModelIndex &index, int role) const override
static QString getAmountColumnTitle(int unit)
Gets title for amount column including current display unit if optionsModel reference available */.
static QString shortName(int unit)
Short name.
static QString formatWithPrivacy(int unit, const CAmount &amount, SeparatorStyle separators, bool privacy)
Format as string (with unit) of fixed length to preserve privacy, if it is set.
BitcoinUnits(QObject *parent)
@ UnitRole
Unit identifier.
static QString format(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD, bool justify=false)
Format as string.