The quantity on the invoice line was 0.0000001. What came out the other side was the text "1e-7".
Nobody typed that. A caller passed a JavaScript number, the number got stringified on its way into the document, and exponent form is simply what JavaScript gives you for small values. The invoice field (BT-129, line quantity) has no room for it. A receiving validator rejects the document, and you learn about it after the thing has already left your system.
In our open-source project invoicerules we fixed it by making the parser branch on the argument type before it looks at the text at all.
A number goes through a helper that writes the exponent out: zeros prefixed after the point when the point lands at or before zero, zeros appended when it lands past the last digit, digits split otherwise. A string is taken exactly as written. Either way the text gets trimmed and tested against the decimal pattern before it becomes units and scale, and anything that fails is an InvalidNumber, NaN and Infinity included.
So parsing the number 1e-7 gives you 0.0000001. Parsing the string "1e-7" still throws.
That asymmetry is deliberate. A number can arrive in exponent form with no human anywhere near it. A string in that form means someone typed it, and quietly accepting it would bury a data-entry problem instead of surfacing it. We normalize where the provenance is a machine. We refuse where the provenance is a person.
The rest followed from there. The quantity field widened to string or number, so existing callers passing numbers stay untouched. And the quantity is now parsed once per line, with that single result feeding the non-negative check under POSITIVE_AMOUNTS, the counted value in the PEPPOL-EN16931-R120 message, and the expected line net. One parse instead of three places each forming their own opinion about the same text.
The habit we kept: at every boundary where a typed value becomes document text, decide who produced the representation before deciding whether to clean it up.
Where you let a parser coerce and where you make it refuse is a real decision. We keep landing on provenance as the deciding factor, and we would be curious what rule others use.