24 return strprintf(
"%d.%0*d %s", *
this / currency.baseunit, currency.decimals,
25 (*
this % currency.baseunit) / currency.subunit,
31 Amount n_abs(sign ? -amount : amount);
33 int64_t quotient = n_abs / currency.baseunit;
34 int64_t remainder = (n_abs % currency.baseunit) / currency.subunit;
36 strprintf(
"%s%d.%0*d", sign ?
"-" :
"", quotient,
37 currency.decimals, remainder));
static const Currency XEC
static const Currency BCHA
static constexpr Amount SATOSHI
static constexpr Amount COIN
bool GetBoolArg(const std::string &strArg, bool fDefault) const
Return boolean argument or default value.
constexpr bool DEFAULT_ECASH
static constexpr Amount zero() noexcept
std::string ToString() const
static const Currency & get()