5 #ifndef BITCOIN_QT_BITCOINUNITS_H 6 #define BITCOIN_QT_BITCOINUNITS_H 10 #include <QAbstractListModel> 11 #include <QDataStream> 15 #define REAL_THIN_SP_CP 0x2009 16 #define REAL_THIN_SP_UTF8 "\xE2\x80\x89" 22 #define HTML_HACK_SP "<span style='white-space: nowrap; font-size: 6pt'> </span>" 25 #define THIN_SP_CP REAL_THIN_SP_CP 26 #define THIN_SP_UTF8 REAL_THIN_SP_UTF8 27 #define THIN_SP_HTML HTML_HACK_SP 94 int rowCount(
const QModelIndex &parent)
const override;
95 QVariant
data(
const QModelIndex &index,
int role)
const override;
116 #endif // BITCOIN_QT_BITCOINUNITS_H static QList< Unit > availableUnits()
Get list of units, for drop-down box.
Bitcoin unit definitions.
BitcoinUnits::Unit BitcoinUnit
static QString description(Unit unit)
Longer description.
static bool parse(Unit unit, const QString &value, CAmount *val_out)
Parse string to coin amount.
QDataStream & operator<<(QDataStream &out, const BitcoinUnit &unit)
static QString formatWithUnit(Unit unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD)
Format as string (with unit)
int64_t CAmount
Amount in satoshis (Can be negative)
static QString formatWithPrivacy(Unit 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)
static QString format(Unit unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD, bool justify=false)
Format as string.
static int decimals(Unit unit)
Number of decimals left.
int rowCount(const QModelIndex &parent) const override
static QString removeSpaces(QString text)
QVariant data(const QModelIndex &index, int role) const override
QDataStream & operator>>(QDataStream &in, BitcoinUnit &unit)
static QString getAmountColumnTitle(Unit unit)
Gets title for amount column including current display unit if optionsModel reference available */...
static QString formatHtmlWithUnit(Unit unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD)
Format as HTML string (with unit)
static QString shortName(Unit unit)
Short name.
static QString longName(Unit unit)
Long name.
static CAmount maxMoney()
Return maximum number of base units (Satoshis)
static qint64 factor(Unit unit)
Number of Satoshis (1e-8) per unit.