# DT-CIUS-PT-020_3.1

Source: https://xmlvalid.com/rules/DT-CIUS-PT-020_3.1

> The BT-22 when prefixed with '#CALCULATIONRATE#', have to meet the defined format: decimal value with 5 decimal places and 9 unit places.

- Level: error
- Rule sets: CIUS-PT rules (Portugal, UBL) 2.1.1
- Context: `//ubl:Invoice/cbc:Note | //cn:CreditNote/cbc:Note`
- Test: `starts-with(normalize-space(.),'#CALCULATIONRATE#') and not(matches(normalize-space(substring-before(substring-after(.,'#CALCULATIONRATE#'),'#')),'^(\d{1,9}\.\d{2,5})$'))`

Validate a document against these rules: https://xmlvalid.com/validate
