| 64 | REGISTER_TYPE_TO_STRING(amount_msat, fmt_amount_msat_ptr); |
| 65 | |
| 66 | const 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 | |
| 79 | const char *fmt_amount_sat(const tal_t *ctx, struct amount_sat sat) |
| 80 | { |