Message

Amounts shall be decimal up to two fraction digits

Context
//*[ends-with(name(), 'Amount') and not(ends-with(name(),'PriceAmount')) and not(ancestor::cac:Price/cac:AllowanceCharge)]
Test
string-length(substring-after(.,'.'))<=2
Usage
/ ubl:Invoice / cac:AllowanceCharge / cbc:Amount
/ ubl:Invoice / cac:AllowanceCharge / cbc:BaseAmount
/ ubl:Invoice / cac:TaxTotal / cbc:TaxAmount
/ ubl:Invoice / cac:TaxTotal / cac:TaxSubtotal / cbc:TaxableAmount
/ ubl:Invoice / cac:TaxTotal / cac:TaxSubtotal / cbc:TaxAmount
/ ubl:Invoice / cac:LegalMonetaryTotal / cbc:LineExtensionAmount
/ ubl:Invoice / cac:LegalMonetaryTotal / cbc:TaxExclusiveAmount
/ ubl:Invoice / cac:LegalMonetaryTotal / cbc:TaxInclusiveAmount
/ ubl:Invoice / cac:LegalMonetaryTotal / cbc:AllowanceTotalAmount
/ ubl:Invoice / cac:LegalMonetaryTotal / cbc:ChargeTotalAmount
/ ubl:Invoice / cac:LegalMonetaryTotal / cbc:PrepaidAmount
/ ubl:Invoice / cac:LegalMonetaryTotal / cbc:PayableRoundingAmount
/ ubl:Invoice / cac:LegalMonetaryTotal / cbc:PayableAmount
/ ubl:Invoice / cac:InvoiceLine / cbc:LineExtensionAmount
/ ubl:Invoice / cac:InvoiceLine / cac:AllowanceCharge / cbc:Amount
/ ubl:Invoice / cac:InvoiceLine / cac:AllowanceCharge / cbc:BaseAmount
/ ubl:CreditNote / cac:AllowanceCharge / cbc:Amount
/ ubl:CreditNote / cac:AllowanceCharge / cbc:BaseAmount
/ ubl:CreditNote / cac:TaxTotal / cbc:TaxAmount
/ ubl:CreditNote / cac:TaxTotal / cac:TaxSubtotal / cbc:TaxableAmount
/ ubl:CreditNote / cac:TaxTotal / cac:TaxSubtotal / cbc:TaxAmount
/ ubl:CreditNote / cac:LegalMonetaryTotal / cbc:LineExtensionAmount
/ ubl:CreditNote / cac:LegalMonetaryTotal / cbc:TaxExclusiveAmount
/ ubl:CreditNote / cac:LegalMonetaryTotal / cbc:TaxInclusiveAmount
/ ubl:CreditNote / cac:LegalMonetaryTotal / cbc:AllowanceTotalAmount
/ ubl:CreditNote / cac:LegalMonetaryTotal / cbc:ChargeTotalAmount
/ ubl:CreditNote / cac:LegalMonetaryTotal / cbc:PrepaidAmount
/ ubl:CreditNote / cac:LegalMonetaryTotal / cbc:PayableRoundingAmount
/ ubl:CreditNote / cac:LegalMonetaryTotal / cbc:PayableAmount
/ ubl:CreditNote / cac:CreditNoteLine / cbc:LineExtensionAmount
/ ubl:CreditNote / cac:CreditNoteLine / cac:AllowanceCharge / cbc:Amount
/ ubl:CreditNote / cac:CreditNoteLine / cac:AllowanceCharge / cbc:BaseAmount