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 "<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
53 static bool valid(
int unit);
Bitcoin unit definitions.
@ UnitRole
Unit identifier.
int rowCount(const QModelIndex &parent) const override
QList< BitcoinUnits::Unit > unitlist
static QString formatWithUnit(int unit, const Amount amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD)
Format as string (with unit)
static int decimals(int unit)
Number of decimals left.
QVariant data(const QModelIndex &index, int role) const override
static Amount factor(int unit)
Number of Satoshis (1e-8) per unit.
static bool valid(int unit)
Is unit ID valid?
static QString formatWithPrivacy(int unit, const Amount &amount, SeparatorStyle separators, bool privacy)
Format as string (with unit) of fixed length to preserve privacy, if it is set.
static QString description(int unit)
Longer description.
static QString removeSpaces(QString text)
static QString longName(int unit)
Long name.
static Amount maxMoney()
Return maximum number of base units (Satoshis)
static QList< Unit > availableUnits()
Get list of units, for drop-down box.
static QString format(int unit, const Amount amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD, bool justify=false)
Format as string.
static bool parse(int unit, const QString &value, Amount *val_out)
Parse string to coin amount.
static QString getAmountColumnTitle(int unit)
Gets title for amount column including current display unit if optionsModel reference available */.
Unit
Currency units Please add only sensible ones.
static QString shortName(int unit)
Short name.
static QString formatHtmlWithUnit(int unit, const Amount amount, bool plussign=false, SeparatorStyle separators=SeparatorStyle::STANDARD)
Format as HTML string (with unit)
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...