| 84 | } |
| 85 | |
| 86 | const char *fmt_amount_sat_btc(const tal_t *ctx, |
| 87 | struct amount_sat sat, |
| 88 | bool append_unit) |
| 89 | { |
| 90 | if (sat.satoshis == 0) |
| 91 | return tal_fmt(ctx, append_unit ? "0btc" : "0"); |
| 92 | |
| 93 | return tal_fmt(ctx, "%"PRIu64".%08"PRIu64"%s", |
| 94 | sat.satoshis / SAT_PER_BTC, |
| 95 | sat.satoshis % SAT_PER_BTC, |
| 96 | append_unit ? "btc" : ""); |
| 97 | } |
| 98 | |
| 99 | char *fmt_amount_sat(const tal_t *ctx, struct amount_sat sat) |
| 100 | { |