All rules · en16931 · error
UBL-DT-01
Monetary amounts must be decimal numbers with at most two fraction digits.
Reviewed
Why this rule exists
Currency settles to two decimals. A third implies rounding was not applied where it should have been, and the amount cannot actually be paid.
Why it usually happens
- Serializing an unrounded computed value
- Percentage arithmetic producing three or more decimals
- Applying display formatting — a thousands separator fails outright as a decimal
How to fix it
Round to two decimals before serialization, and never apply display formatting to XML output.
<cbc:PayableAmount currencyID="EUR">100.005</cbc:PayableAmount>
<cbc:PayableAmount currencyID="EUR">100.01</cbc:PayableAmount>
The official rule
Amounts shall be decimal up to two fraction digits
Verbatim from the published artefact. We execute the official Schematron unmodified, so this is exactly what an Access Point checks.
Schematron test
string-length(substring-after(.,'.'))<=2
Applied to nodes matching //*[ends-with(name(), 'Amount') and not(ends-with(name(),'PriceAmount')) and not(ancestor::cac:Price/cac:AllowanceCharge)]
Rule-pack versions
| Rule-pack | Layer | Severity | Applies to |
|---|---|---|---|
| pint-eu-1.1.1 | en16931 | error | billing/creditnote, billing/invoice |
Related rules
Check your own invoice
Paste your XML and see every rule that fires, not just this one. Free, no sign-up, and we never store the document.
Open the validator