Format an Identity Number

You want to ensure that an Identity Number is captured as numeric digits, but that it is rendered in the merged document with formatting or spacing characters.

For example, the South African ID number consists of 4 parts: The first 6 digits are the date of birth of the person, the next four are a tie-breaker (so that people born on the same day get a unique number), and the next two have other meanings. The last digit is a check digit helping to detect transcription errors.

Traditionally, the SA ID number has been written xxxxxx-xxxx-xxx, although writing it with no formatting delimiters is legally acceptable (if not as easy on the human eye).

XpressDox’s FormatNumber function will do two things:

  1. When the data element is captured, a check is done to make sure it is numeric and the user warned if this is not the case.
  2. It will format the number according to the formatting pattern provided.

Thus, the fillpoint to capture a South African ID number as numeric digits and then render it according to the traditional format is:

«FormatNumber(IDNumber,“000000-0000-000”)»