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

Function fmt_amount_sat_btc

common/amount.c:66–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

64REGISTER_TYPE_TO_STRING(amount_msat, fmt_amount_msat_ptr);
65
66const char *fmt_amount_sat_btc(const tal_t *ctx,
67 struct amount_sat sat,
68 bool append_unit)
69{
70 if (sat.satoshis == 0)
71 return tal_fmt(ctx, append_unit ? "0btc" : "0");
72
73 return tal_fmt(ctx, "%"PRIu64".%08"PRIu64"%s",
74 sat.satoshis / SAT_PER_BTC,
75 sat.satoshis % SAT_PER_BTC,
76 append_unit ? "btc" : "");
77}
78
79const char *fmt_amount_sat(const tal_t *ctx, struct amount_sat sat)
80{

Callers 2

runFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by 1

mainFunction · 0.68