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

Function fmt_amount_m_as_sat

common/amount.c:70–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68#define LSIZE 5
69
70char *fmt_amount_m_as_sat(const tal_t *ctx, struct amount_msat msat)
71{
72 char last[LSIZE] = {0};
73
74 if (msat.millisatoshis % MSAT_PER_SAT) {
75 snprintf(last, LSIZE, ".%03"PRIu64,
76 msat.millisatoshis % MSAT_PER_SAT);
77 while(last[strlen(last) - 1] == '0')
78 last[strlen(last) - 1] = 0;
79 }
80
81 return tal_fmt(ctx, "%"PRIu64"%ssat",
82 msat.millisatoshis / MSAT_PER_SAT,
83 last);
84}
85
86const char *fmt_amount_sat_btc(const tal_t *ctx,
87 struct amount_sat sat,

Callers 3

check_balancesFunction · 0.85
channel_txsFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by 1

mainFunction · 0.68