Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
Go to the documentation of this file. 16 int64_t n_abs = (n > 0 ? n : -n);
17 int64_t quotient = n_abs/
COIN;
18 int64_t remainder = n_abs%
COIN;
19 std::string str =
strprintf(
"%d.%08d", quotient, remainder);
23 for (
int i = str.size()-1; (str[i] ==
'0' && isdigit(str[i-2])); --i)
26 str.erase(str.size()-nTrim, nTrim);
29 str.insert((
unsigned int)0, 1,
'-');
43 const char* p = pszIn;
51 int64_t nMult =
CENT*10;
52 while (isdigit(*p) && (nMult > 0))
54 nUnits += nMult * (*p++ -
'0');
63 strWhole.insert(strWhole.end(), *p);
68 if (strWhole.size() > 10)
70 if (nUnits < 0 || nUnits >
COIN)
72 int64_t nWhole =
atoi64(strWhole);
static const CAmount COIN
int64_t CAmount
Amount in satoshis (Can be negative)
bool ParseMoney(const std::string &str, CAmount &nRet)
static const CAmount CENT
std::string FormatMoney(const CAmount &n)
Money parsing/formatting utilities.
int64_t atoi64(const char *psz)