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

Function fmt_amount_msat_btc

common/amount.c:41–52  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

39
40/* Different formatting by amounts: btc, sat and msat */
41const char *fmt_amount_msat_btc(const tal_t *ctx,
42 struct amount_msat msat,
43 bool append_unit)
44{
45 if (msat.millisatoshis == 0)
46 return tal_fmt(ctx, append_unit ? "0btc" : "0");
47
48 return tal_fmt(ctx, "%"PRIu64".%011"PRIu64"%s",
49 msat.millisatoshis / MSAT_PER_BTC,
50 msat.millisatoshis % MSAT_PER_BTC,
51 append_unit ? "btc" : "");
52}
53
54const char *fmt_amount_msat(const tal_t *ctx, struct amount_msat msat)
55{

Callers 6

runFunction · 0.85
mainFunction · 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