Attestwire › Rule reference › ATW-NUMBER-NOT-FINITE
ATW-NUMBER-NOT-FINITE Every number in the invoice must be finite
noun · Attestwire · fatal · BG-27
For a sample invoice, the library reports: lines[0].allowances[0].percentage is NaN. The XML type behind it, xs:decimal, has no NaN or infinity, so the document cannot be written.
- Business term
BG-27- Severity
fatal
The fix
Check the arithmetic that produced it: a division by zero, or a sum over a missing value, is the usual cause.
What the library returns
The full error returned by @attestwire/en16931. It includes the rule ID,
affected field and suggested correction. Developers can use this object in their application:
{
"rule": "ATW-NUMBER-NOT-FINITE",
"field": "BG-27",
"severity": "fatal",
"message": "lines[0].allowances[0].percentage is NaN. The XML type behind it, xs:decimal, has no NaN or infinity, so the document cannot be written.",
"fix": "Check the arithmetic that produced it: a division by zero, or a sum over a missing value, is the usual cause.",
"docsUrl": "https://github.com/attestwire/en16931#not-implemented-yet"
}