Commit graph

3 commits

Author SHA1 Message Date
Ken Sedgwick
10ffad5099
Util::Str::group_digits -- readable msat/sat amounts in the xrebalance logs
Large amounts in the XRebalancer / XMoveFunds log lines were
unbroken digit runs (delivered 18851040 msat); grep-heavy log
sessions kept miscounting them.  Add Util::Str::group_digits,
which renders an integer with an underscore every three digit
places (18_851_040), matching the digit grouping
clboss-xrebalance-view and the other contrib tools already
print.

Applied to the amounts that get large:
- XRebalancer cycle line (derived N, request)
- XRebalancer transfer-done line (delivered, fee)
- XMoveFunds planning line (amount, maxfee)
- XMoveFunds 204 summary and fee-picture diagnostics
  (alloc_fee, required_out)
- XMoveFunds per-part budget refusals (would deliver)
- format_route_fees per-hop table (in/out/fee)

Counts, ppm values, and cltv deltas stay plain.  Signed
overload handles the int64 call sites (INT64_MIN-safe).

New tests/util/test_str covers both overloads and the
boundary cases.
2026-08-04 11:02:00 -07:00
ZmnSCPxj jxPCSnmZ
5d611109ef Util/Str.cpp: Implement Util::Str::fmt. 2021-10-06 19:26:55 +08:00
ZmnSCPxj jxPCSnmZ
289fb1762b Util/Str.cpp: String utilities. 2020-08-24 20:03:09 +08:00