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"
16 #define REAL_THIN_SP_HTML " "
19 #define HAIR_SP_CP 0x200A
20 #define HAIR_SP_UTF8 "\xE2\x80\x8A"
21 #define HAIR_SP_HTML " "
24 #define SIXPEREM_SP_CP 0x2006
25 #define SIXPEREM_SP_UTF8 "\xE2\x80\x86"
26 #define SIXPEREM_SP_HTML " "
29 #define FIGURE_SP_CP 0x2007
30 #define FIGURE_SP_UTF8 "\xE2\x80\x87"
31 #define FIGURE_SP_HTML " "
37 #define HTML_HACK_SP "<span style='white-space: nowrap; font-size: 6pt'> </span>"
40 #define THIN_SP_CP REAL_THIN_SP_CP
41 #define THIN_SP_UTF8 REAL_THIN_SP_UTF8
42 #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);
96 static bool parse(
int unit,
const QString &value,
CAmount *val_out);
108 int rowCount(
const QModelIndex &parent)
const;
109 QVariant
data(
const QModelIndex &index,
int role)
const;
116 #if (THIN_SP_CP != REAL_THIN_SP_CP)
int64_t CAmount
Amount in satoshis (Can be negative)
BitcoinUnits::Unit BitcoinUnit
Bitcoin unit definitions.
@ UnitRole
Unit identifier.
QList< BitcoinUnits::Unit > unitlist
static bool parse(int unit, const QString &value, CAmount *val_out)
Parse string to coin amount.
static CAmount maxMoney()
Return maximum number of base units (Satoshis)
static int decimals(int unit)
Number of decimals left.
static QString name(int unit)
Short name.
QVariant data(const QModelIndex &index, int role) const
static QString formatHtmlWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as HTML string (with unit)
static bool valid(int unit)
Is unit ID valid?
static QString description(int unit)
Longer description.
static QString removeSpaces(QString text)
int rowCount(const QModelIndex &parent) const
static QString format(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string.
static QList< Unit > availableUnits()
Get list of units, for drop-down box.
static QString getAmountColumnTitle(int unit)
Gets title for amount column including current display unit if optionsModel reference available */.
BitcoinUnits(QObject *parent)
static qint64 factor(int unit)
Number of Satoshis (1e-8) per unit.
static QString formatWithUnit(int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard)
Format as string (with unit)