just send the amount as bigint#497
Conversation
there's no real reason to parse it on both sides
|
Maybe it's better to have human readable numbers?! |
|
Here's my review of PR #497 — "just send the amount as bigint". SummaryThe PR replaces locale-aware wire-amount formatting ( Verdict: LGTM with a couple of notesThis is a clean, well-motivated simplification — the rationale ("less error prone, no parsing/formatting") is sound. Machine-to-machine wire transport of a fixed-precision integer has no business going through a decimal/locale codec. Strong DRY win, removes a whole class of locale ambiguity (comma vs dot decimal mark), and the tests stay coherent with the new shape. Things I'd flag before merging
BigInt.tryParse(widget.initialAmount!) ?? BigInt.zeroPre-existing behavior, not a regression, but worth surfacing: a malformed
Suggested follow-ups (non-blocking)
Overall: ship it. The simplification is the right call for a machine-readable wire format. |
use big int for wire transport, no need for parsing and formatting
this is less error prone too