Previous Topic

Next Topic

FormatBankAccountNo - MaxBasic Function

FormatBankAccountNo(BankAcct: String, Pattern: String[, CountryCode: String]): String

Returns a formatted bank account number given a valid BankAcct string and valid Pattern string.

Currently only NZ bank accounts are supported.

FormatBankAccountNo function syntax has these named arguments:

Parameter

Description

BankAcct

Required. The bank account to be formatted.

If separators are included (dot, dash, or space) the number is broken into parts on the separators, if there are no separators for NZ accounts the parts break into 2, 4, 8, 2 or 3 character blocks per the original databank spec.

Pattern

Required. number of digits and desired separator for the formatted account number. Valid characters dot, dash, space and digits (1-9). Validity of the pattern is checked. e.g. "2-4-7-2".

CountryCode

Optional, defaults to Company Country Code if not specified. The country for the Bank Account. Currently only NZ supported other Country Codes will error.

For example:

  FormatBankAccountNo("0109020006838900","2-4-7-2","NZ")

Returns: "01-0902-0068389-00"

FormatBankAccountNo("01 0902 0068389 001","2-4-7-2","NZ")

Returns: "01-0902-0068389-01"

See Also

String Functions

Book Contents

Book Index