MCPcopy Create free account
hub / github.com/ElementsProject/elements / ValueFromAmount

Function ValueFromAmount

src/core_write.cpp:51–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49static RPCRawTransaction_ECC_Init ecc_init_on_load;
50
51UniValue ValueFromAmount(const CAmount amount)
52{
53 static_assert(COIN > 1);
54 int64_t quotient = amount / COIN;
55 int64_t remainder = amount % COIN;
56 if (amount < 0) {
57 quotient = -quotient;
58 remainder = -remainder;
59 }
60 return UniValue(UniValue::VNUM,
61 strprintf("%s%d.%08d", amount < 0 ? "-" : "", quotient, remainder));
62}
63
64std::string FormatScript(const CScript& script)
65{

Callers 15

TxToUnivFunction · 0.85
rest_getutxosFunction · 0.85
listaddressgroupingsFunction · 0.85
listunspentFunction · 0.85
fundrawtransactionFunction · 0.85
bumpfee_helperFunction · 0.85
walletcreatefundedpsbtFunction · 0.85
getwalletinfoFunction · 0.85
listissuancesFunction · 0.85
transactions.cppFile · 0.85
BOOST_AUTO_TEST_CASEFunction · 0.85
GetJSONMethod · 0.85

Calls 1

UniValueClass · 0.70

Tested by 3

BOOST_AUTO_TEST_CASEFunction · 0.68
GetJSONMethod · 0.68
FUZZ_TARGET_INITFunction · 0.68