Predicate function - Financial
The financial functions are used for validating financial identifiers, account numbers, amounts, and financial calculations.
-
Financial predicate functions validate defined formats, structures, and calculations only; they do not confirm real‑world existence unless explicitly stated.
-
Identifier validations (such as IBAN, SWIFT/BIC, VAT, and currency codes) apply format and checksum rules, not registry or bank verification.
-
Amount validations are culture‑aware, support currency symbols and separators, and reject non‑finite values (NaN, Infinity).
|
Function |
Description |
Example |
|---|---|---|
| IsValidIBAN(value) | Returns true if the value is a valid International Bank Account Number (2-letter country code + 2 check digits + up to 30 alphanumeric characters). |
|
| IsValidSWIFT(value) | Returns true if the value is a valid SWIFT code (4-letter bank code + 2-letter country code + 2-character location code + optional 3-character branch code). |
|
| IsValidBIC(value) | Returns true if the value is a valid Bank Identifier Code (4-letter bank code + 2-letter country code + 2-character location code + optional 3-character branch code). |
|
| IsValidVAT(value) | Returns true if the value is a valid VAT number format (2-letter country code followed by 2-13 alphanumeric characters). |
|
| IsValidAccountNumber(value) | Returns true if the value is a valid account number (8 to 17 digits). |
|
| IsValidRoutingNumber(value) | Returns true if the value is a valid routing number (must be exactly 9 digits and pass the routing number checksum algorithm: (3*(d0+d3+d6) + 7*(d1+d4+d7) + (d2+d5+d8)) mod 10 = 0). |
|
| IsValidSortCode(value) | Returns true if the value is a valid sort code (6 digits). |
|
| IsCreditCardNumber(value) | Returns true if the value is a valid credit card number (13-19 digits). |
|
| IsCurrencyCode(value) | Returns true if the value is a valid ISO 4217 currency code format (exactly 3 uppercase letters). |
|
| IsAmountPositive(value) | Returns true if the amount is positive (greater than zero). |
|
| IsAmountNegative(value) | Returns true if the amount is negative (less than zero). |
|
| IsAmountBetween(value, min, max) | Returns true if the amount is between minimum and maximum values (inclusive by default). |
|
| IsTaxCalculationValid(net, taxRate, gross) | Returns true if net + (net * taxRate) equals gross. |
|
| IsLineItemTotalValid(itemPrice, quantity, totalPrice) | Returns true if itemPrice * quantity equals totalPrice. |
|
| IsDiscountValid(originalPrice, discountAmount, finalPrice) | Returns true if originalPrice - discountAmount equals finalPrice. |
|