24 for (
int i = str.size() - 1; (str[i] ==
'0' &&
IsDigit(str[i - 2])); --i) {
32 str.insert((
unsigned int)0, 1,
'-');
49 const char *
p = str.c_str();
std::string FormatMoney(const Amount amt)
Do not use these functions to represent or parse monetary amounts to or from JSON but use AmountFromV...
bool ParseMoney(const std::string &money_string, Amount &nRet)
Parse an amount denoted in full coins.
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...
constexpr bool IsDigit(char c)
Tests if the given character is a decimal digit.
constexpr bool IsSpace(char c) noexcept
Tests if the given character is a whitespace character.
std::string TrimString(std::string_view str, std::string_view pattern=" \f\n\r\t\v")
bool ContainsNoNUL(std::string_view str) noexcept
Check if a string does not contain any embedded NUL (\0) characters.
static constexpr Amount zero() noexcept
static const Currency & get()
int64_t atoi64(const std::string &str)