| 68 | #define LSIZE 5 |
| 69 | |
| 70 | char *fmt_amount_m_as_sat(const tal_t *ctx, struct amount_msat msat) |
| 71 | { |
| 72 | char last[LSIZE] = {0}; |
| 73 | |
| 74 | if (msat.millisatoshis % MSAT_PER_SAT) { |
| 75 | snprintf(last, LSIZE, ".%03"PRIu64, |
| 76 | msat.millisatoshis % MSAT_PER_SAT); |
| 77 | while(last[strlen(last) - 1] == '0') |
| 78 | last[strlen(last) - 1] = 0; |
| 79 | } |
| 80 | |
| 81 | return tal_fmt(ctx, "%"PRIu64"%ssat", |
| 82 | msat.millisatoshis / MSAT_PER_SAT, |
| 83 | last); |
| 84 | } |
| 85 | |
| 86 | const char *fmt_amount_sat_btc(const tal_t *ctx, |
| 87 | struct amount_sat sat, |
no outgoing calls