MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / ValueFromAmount

Function ValueFromAmount

src/core_io.cpp:283–294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

281}
282
283UniValue ValueFromAmount(const CAmount amount)
284{
285 static_assert(COIN > 1);
286 int64_t quotient = amount / COIN;
287 int64_t remainder = amount % COIN;
288 if (amount < 0) {
289 quotient = -quotient;
290 remainder = -remainder;
291 }
292 return UniValue(UniValue::VNUM,
293 strprintf("%s%d.%08d", amount < 0 ? "-" : "", quotient, remainder));
294}
295
296std::string FormatScript(const CScript& script)
297{

Callers 15

BlockUndoToJSONFunction · 0.85
rest_getutxosFunction · 0.85
TxToUnivFunction · 0.85
listaddressgroupingsFunction · 0.85
getreceivedbyaddressFunction · 0.85
getreceivedbylabelFunction · 0.85
getbalanceFunction · 0.85
getbalancesFunction · 0.85
listunspentFunction · 0.85
fundrawtransactionFunction · 0.85
bumpfee_helperFunction · 0.85
walletcreatefundedpsbtFunction · 0.85

Calls 1

UniValueClass · 0.70

Tested by 2

BOOST_AUTO_TEST_CASEFunction · 0.68
GetJSONMethod · 0.68