Different formatting by amounts: btc, sat and msat */
| 39 | |
| 40 | /* Different formatting by amounts: btc, sat and msat */ |
| 41 | const 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 | |
| 54 | const char *fmt_amount_msat(const tal_t *ctx, struct amount_msat msat) |
| 55 | { |
no outgoing calls