Different formatting by amounts: btc, sat and msat */
| 48 | |
| 49 | /* Different formatting by amounts: btc, sat and msat */ |
| 50 | const 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 | |
| 63 | char *fmt_amount_msat(const tal_t *ctx, struct amount_msat msat) |
| 64 | { |
no outgoing calls