![]() |
PRCYCoin
2.0.0.7rc1
P2P Digital Currency
|
PRCY unit definitions. More...
#include <bitcoinunits.h>
Public Types | |
| enum | Unit { PRCY, mPRCY, uPRCY } |
| PRCY units. More... | |
| enum | SeparatorStyle { separatorNever, separatorStandard, separatorAlways } |
Public Member Functions | |
| BitcoinUnits (QObject *parent) | |
Static Public Member Functions | |
| static QString | removeSpaces (QString text) |
| static CAmount | maxMoney () |
| Return maximum number of base units (Satoshis) More... | |
Static API | |
Unit conversion and formatting | |
| static QList< Unit > | availableUnits () |
| Get list of units, for drop-down box. More... | |
| static bool | valid (int unit) |
| Is unit ID valid? More... | |
| static QString | id (int unit) |
| Identifier, e.g. for image names. More... | |
| static QString | name (int unit) |
| Short name. More... | |
| static QString | description (int unit) |
| Longer description. More... | |
| static qint64 | factor (int unit) |
| Number of Satoshis (1e-8) per unit. More... | |
| static int | decimals (int unit) |
| Number of decimals left. More... | |
| static QString | format (int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard) |
| Format as string. More... | |
| static QString | simpleFormat (int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard) |
| static QString | formatWithUnit (int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard) |
| Format as string (with unit) More... | |
| static QString | formatHtmlWithUnit (int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard) |
| 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. More... | |
| static QString | floorHtmlWithUnit (int unit, const CAmount &amount, bool plussign=false, SeparatorStyle separators=separatorStandard) |
| static bool | parse (int unit, const QString &value, CAmount *val_out) |
| Parse string to coin amount. More... | |
| static QString | getAmountColumnTitle (int unit) |
| Gets title for amount column including current display unit if optionsModel reference available */. More... | |
Private Attributes | |
| QList< BitcoinUnits::Unit > | unitlist |
AbstractListModel implementation | |
| enum | RoleIndex { UnitRole = Qt::UserRole } |
| int | rowCount (const QModelIndex &parent) const |
| QVariant | data (const QModelIndex &index, int role) const |
PRCY unit definitions.
Encapsulates parsing and formatting and serves as list model for drop-down selection boxes.
Definition at line 50 of file bitcoinunits.h.
| Enumerator | |
|---|---|
| UnitRole | Unit identifier. |
Definition at line 108 of file bitcoinunits.h.
| Enumerator | |
|---|---|
| separatorNever | |
| separatorStandard | |
| separatorAlways | |
Definition at line 66 of file bitcoinunits.h.
| enum BitcoinUnits::Unit |
PRCY units.
| Enumerator | |
|---|---|
| PRCY | |
| mPRCY | |
| uPRCY | |
Definition at line 60 of file bitcoinunits.h.
|
explicit |
Definition at line 16 of file bitcoinunits.cpp.
|
static |
Get list of units, for drop-down box.
Definition at line 21 of file bitcoinunits.cpp.
| QVariant BitcoinUnits::data | ( | const QModelIndex & | index, |
| int | role | ||
| ) | const |
|
static |
Number of decimals left.
Definition at line 126 of file bitcoinunits.cpp.
|
static |
Longer description.
Definition at line 84 of file bitcoinunits.cpp.
|
static |
Number of Satoshis (1e-8) per unit.
Definition at line 112 of file bitcoinunits.cpp.
|
static |
Definition at line 213 of file bitcoinunits.cpp.
|
static |
Format as string (with unit) but floor value up to "digits" settings.
Definition at line 202 of file bitcoinunits.cpp.
|
static |
Format as string.
Definition at line 140 of file bitcoinunits.cpp.
|
static |
Definition at line 195 of file bitcoinunits.cpp.
|
static |
Format as string (with unit)
: Review all remaining calls to BitcoinUnits::formatWithUnit to
: determine whether the output is used in a plain text context
: or an HTML context (and replace with
: BtcoinUnits::formatHtmlWithUnit in the latter case).
: either context.
Hopefully
Definition at line 190 of file bitcoinunits.cpp.
|
static |
Gets title for amount column including current display unit if optionsModel reference available */.
Definition at line 254 of file bitcoinunits.cpp.
|
static |
Identifier, e.g. for image names.
Definition at line 42 of file bitcoinunits.cpp.
|
static |
Return maximum number of base units (Satoshis)
Definition at line 287 of file bitcoinunits.cpp.
|
static |
Short name.
Definition at line 56 of file bitcoinunits.cpp.
|
static |
Parse string to coin amount.
Definition at line 220 of file bitcoinunits.cpp.
|
inlinestatic |
| int BitcoinUnits::rowCount | ( | const QModelIndex & | parent | ) | const |
Definition at line 263 of file bitcoinunits.cpp.
|
static |
|
static |
Is unit ID valid?
Definition at line 30 of file bitcoinunits.cpp.
|
private |
Definition at line 130 of file bitcoinunits.h.
1.8.17