JavaScript Editor js editor     Web development 

Main Page

You can create a variety of formats for output generated from Field controls by creating a format string expression. A format string contains format codes and format templates.

Format Codes

Format codes apply to all the characters in the Field control expression and must be preceded by the at sign (@) in the format string. For example, you can pad a numeric value with leading zeros instead of spaces by using the format string "@L 999999".

Format Code: Description: Applies to data of type:


Force text to uppercase.

Character only


Left justify .

All types


Right justify.

All types


Center justify.

All types


Leading zeros.

Numeric only


Blank if zero.

Numeric, Date, and DateTime


Surround negative numbers with ().

Numeric only


Appends " CR" to positive, non-zero numbers.

Numeric only


Appends " DB" to negative, non-zero numbers.

Numeric only


Uses currency notation.

Numeric only


Use current SET DATE setting.

All types


Display as if SET DATE BRITISH was in effect.

All types


Display using system Long Date format.



Display using system Short Date format.



Prevents non-formatting characters in the template string from replacing the corresponding character of the field expression value. When @R is used, the template string interleaves instead of overlaying. (See example below.)

Character and Numeric


  • Numeric data is right-justified by default.

  • Character and Date data are left-justified by default.

  • You can use combinations of format codes. For example "@CX" will display both credits and debits on numeric data, where appropriate.

For more information about how format codes are used in form controls, see Format Property.

Template Characters

Format template characters apply to individual characters in the Field control expression. You can create a pattern with format template characters with each character in the template representing a character you want to display. For example, some characters in a format template alter the display of specific character types. For example, including the character "Y" in a format template for a logical expression displays the letters "Y" instead of ".T." for True and "N" instead of ".F." for False. The character "9" in a format template is a placeholder for any digit in character or numeric data. Other format template characters, such as parentheses, spaces, and hyphens, display as themselves.

For more information about format template characters, see InputMask Property.


The following examples show how format codes and format template characters work together to create the output:

Field Expression Value Format String Rendered Output


@(CX 999.999

( 43.050 DB)


(999) 999-9999

( ) - -43


(999) 999-9999

(505) 102-


@R (999) 999-9999

(450) 555-1023


@R !! 99999

CA 90210

See Also

JavaScript Editor js editor     Web development