MCPcopy Create free account
hub / github.com/ElementsProject/lightning / fmt_amount_msat_btc

Function fmt_amount_msat_btc

common/amount.c:50–61  ·  view source on GitHub ↗

Different formatting by amounts: btc, sat and msat */

Source from the content-addressed store, hash-verified

48
49/* Different formatting by amounts: btc, sat and msat */
50const char *fmt_amount_msat_btc(const tal_t *ctx,
51 struct amount_msat msat,
52 bool append_unit)
53{
54 if (msat.millisatoshis == 0)
55 return tal_fmt(ctx, append_unit ? "0btc" : "0");
56
57 return tal_fmt(ctx, "%"PRIu64".%011"PRIu64"%s",
58 msat.millisatoshis / MSAT_PER_BTC,
59 msat.millisatoshis % MSAT_PER_BTC,
60 append_unit ? "btc" : "");
61}
62
63char *fmt_amount_msat(const tal_t *ctx, struct amount_msat msat)
64{

Callers 10

runFunction · 0.85
mainFunction · 0.85
report_fmt_creditFunction · 0.85
report_fmt_debitFunction · 0.85
report_fmt_feesFunction · 0.85
report_fmt_credit_debitFunction · 0.85
cointrack_entryFunction · 0.85
koinly_entryFunction · 0.85
harmony_entryFunction · 0.85
quickbooks_entryFunction · 0.85

Calls

no outgoing calls

Tested by 1

mainFunction · 0.68