Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoinunits.h
Show First 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | public: | ||||
static QString name(int unit); | static QString name(int unit); | ||||
//! Longer description | //! Longer description | ||||
static QString description(int unit); | static QString description(int unit); | ||||
//! Number of Satoshis (1e-8) per unit | //! Number of Satoshis (1e-8) per unit | ||||
static qint64 factor(int unit); | static qint64 factor(int unit); | ||||
//! Number of decimals left | //! Number of decimals left | ||||
static int decimals(int unit); | static int decimals(int unit); | ||||
//! Format as string | //! Format as string | ||||
static QString format(int unit, const CAmount &amount, | static QString format(int unit, const Amount amount, bool plussign = false, | ||||
bool plussign = false, | |||||
SeparatorStyle separators = separatorStandard); | SeparatorStyle separators = separatorStandard); | ||||
//! Format as string (with unit) | //! Format as string (with unit) | ||||
static QString | static QString | ||||
formatWithUnit(int unit, const CAmount &amount, bool plussign = false, | formatWithUnit(int unit, const Amount amount, bool plussign = false, | ||||
SeparatorStyle separators = separatorStandard); | SeparatorStyle separators = separatorStandard); | ||||
//! Format as HTML string (with unit) | //! Format as HTML string (with unit) | ||||
static QString | static QString | ||||
formatHtmlWithUnit(int unit, const CAmount &amount, bool plussign = false, | formatHtmlWithUnit(int unit, const Amount amount, bool plussign = false, | ||||
SeparatorStyle separators = separatorStandard); | SeparatorStyle separators = separatorStandard); | ||||
//! Parse string to coin amount | //! Parse string to coin amount | ||||
static bool parse(int unit, const QString &value, CAmount *val_out); | static bool parse(int unit, const QString &value, Amount *val_out); | ||||
//! Gets title for amount column including current display unit if | //! Gets title for amount column including current display unit if | ||||
//! optionsModel reference available */ | //! optionsModel reference available */ | ||||
static QString getAmountColumnTitle(int unit); | static QString getAmountColumnTitle(int unit); | ||||
///@} | ///@} | ||||
//! @name AbstractListModel implementation | //! @name AbstractListModel implementation | ||||
//! List model for unit drop-down selection box. | //! List model for unit drop-down selection box. | ||||
///@{ | ///@{ | ||||
Show All 10 Lines | static QString removeSpaces(QString text) { | ||||
text.remove(QChar(THIN_SP_CP)); | text.remove(QChar(THIN_SP_CP)); | ||||
#if (THIN_SP_CP != REAL_THIN_SP_CP) | #if (THIN_SP_CP != REAL_THIN_SP_CP) | ||||
text.remove(QChar(REAL_THIN_SP_CP)); | text.remove(QChar(REAL_THIN_SP_CP)); | ||||
#endif | #endif | ||||
return text; | return text; | ||||
} | } | ||||
//! Return maximum number of base units (Satoshis) | //! Return maximum number of base units (Satoshis) | ||||
static CAmount maxMoney(); | static Amount maxMoney(); | ||||
private: | private: | ||||
QList<BitcoinUnits::Unit> unitlist; | QList<BitcoinUnits::Unit> unitlist; | ||||
}; | }; | ||||
typedef BitcoinUnits::Unit BitcoinUnit; | typedef BitcoinUnits::Unit BitcoinUnit; | ||||
#endif // BITCOIN_QT_BITCOINUNITS_H | #endif // BITCOIN_QT_BITCOINUNITS_H |