| 17 | #include <utilstrencodings.h> |
| 18 | |
| 19 | UniValue ValueFromAmount(const CAmount& amount) |
| 20 | { |
| 21 | bool sign = amount < 0; |
| 22 | int64_t n_abs = (sign ? -amount : amount); |
| 23 | int64_t quotient = n_abs / COIN; |
| 24 | int64_t remainder = n_abs % COIN; |
| 25 | return UniValue(UniValue::VNUM, |
| 26 | strprintf("%s%d.%08d", sign ? "-" : "", quotient, remainder)); |
| 27 | } |
| 28 | |
| 29 | std::string FormatScript(const CScript& script) |
| 30 | { |