6 #ifndef BITCOIN_QT_BITCOINUNITS_H 7 #define BITCOIN_QT_BITCOINUNITS_H 11 #include <QAbstractListModel> 15 #define REAL_THIN_SP_CP 0x2009 16 #define REAL_THIN_SP_UTF8 "\xE2\x80\x89" 17 #define REAL_THIN_SP_HTML " " 20 #define HAIR_SP_CP 0x200A 21 #define HAIR_SP_UTF8 "\xE2\x80\x8A" 22 #define HAIR_SP_HTML " " 25 #define SIXPEREM_SP_CP 0x2006 26 #define SIXPEREM_SP_UTF8 "\xE2\x80\x86" 27 #define SIXPEREM_SP_HTML " " 30 #define FIGURE_SP_CP 0x2007 31 #define FIGURE_SP_UTF8 "\xE2\x80\x87" 32 #define FIGURE_SP_HTML " " 38 #define HTML_HACK_SP "<span style='white-space: nowrap; font-size: 6pt'> </span>" 41 #define THIN_SP_CP REAL_THIN_SP_CP 42 #define THIN_SP_UTF8 REAL_THIN_SP_UTF8 43 #define THIN_SP_HTML HTML_HACK_SP 80 static bool valid(
int unit);
82 static QString
name(
int unit);
86 static qint64
factor(
int unit);
100 static bool parse(
int unit,
const QString &value,
CAmount *val_out);
112 int rowCount(
const QModelIndex &parent)
const;
113 QVariant
data(
const QModelIndex &index,
int role)
const;
120 #if (THIN_SP_CP != REAL_THIN_SP_CP) 134 #endif // BITCOIN_QT_BITCOINUNITS_H static QString floorWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string (with unit) but floor value up to "digits" settings.
BitcoinUnits::Unit BitcoinUnit
static QString getAmountColumnTitle(int unit)
Gets title for amount column including current display unit if optionsModel reference available */...
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 formatWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string (with unit)
static CAmount maxMoney()
Return maximum number of base units (Satoshis)
static QString floorHtmlWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
static QString formatHtmlWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as HTML string (with unit)
int rowCount(const QModelIndex &parent) const
static qint64 factor(int unit)
Number of Satoshis (1e-8) per unit.
static QString format(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string.
static QString simpleFormat(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
QVariant data(const QModelIndex &index, int role) const
static int decimals(int unit)
Number of decimals left.
QList< BitcoinUnits::Unit > unitlist
BitcoinUnits(QObject *parent)
static QString name(int unit)
Short name.
static QString removeSpaces(QString text)
static QList< Unit > availableUnits()
Get list of units, for drop-down box.
static QString description(int unit)
Longer description.