Faktura

UBL-DT-01

fatalEN 16931syntax binding ruleUBL

Amounts shall be decimal up to two fraction digits

Why it fails

An amount has more than two decimal places.

How to fix it

Round every amount to 2 decimals and serialise it as a fixed-point string. Floating-point formatting is the usual culprit: 12.340000000000001 fails this.

What the validator checks

UBL — context //*[ends-with(name(), 'Amount') and not(ends-with(name(),'PriceAmount')) and not(ancestor::cac:Price/cac:AllowanceCharge)]

string-length(substring-after(.,'.'))<=2

Related rules

Part of UBL-DT — UBL data types.

Validate an invoice against this rule →