Other Formats

<< Click to Display Table of Contents >>

 

Other Formats

In the Other option, users can create any type of format, even one from the previous section, by typing a format code (a text).

The text format is made of up to four fields separated by a semicolon. The first field is always applied when there is no other field more appropriated for that value or data type. The second field is used for negative numerical values. The third field is used whenever the numerical value is 0 (zero). Finally, the fourth field is used for Text-type values.

Whenever more than one field is defined, the previous field is considered, even if it is empty. In the event of an empty field format, the formatted value is always an empty text. Notice how this differs from the General format, which is only an empty format without field separators (semicolons).

To insert characters that are displayed by a format, users can place them between quotes or after a backslash. The next table contains examples of input texts, which are valid for all format types.

Text Input

Format

Formatted Output

"0#?"

0#?

\m\d\y

mdy

 

Users can also create formats that contain only text, which can be combined with the use of different fields, as described on the next table.

Format and Formatted Output

Value

Format

Formatted Output

1

"Positive";"Negative";"Zero","Text"

Positive

-1

"Positive";"Negative";"Zero","Text"

Negative

0

"Positive";"Negative";"Zero","Text"

Zero

"Abcd"

"Positive";"Negative";"Zero","Text"

Text

 

In addition, the characters that can be displayed directly without using quotation marks or slashes are $ (dollar sign), - (dash), + (plus sign), / (slash mark), () (parentheses), : (colon), ! (exclamation point), ^ (caret), & (ampersand), ' (simple quote to the left), ' (simple quote to the right), ~ (tilde), {} (braces), = (equal to), < (less than), and > (greater than).

 

NOTE

To display a backslash or double quotation marks in the formatted data, use \" or \\. When the text is between quotation marks, the whole text is copied directly, so "\a" is displayed simply as \a.

 

Numerical formats accept three basic types of characters to define the number of displayed digits.

Numerical Formats

Option

Description

0 (zero)

Inserts the significant digit or 0 (zero) when there is none

#

Inserts the significant digit

?

Inserts the significant digit or a blank space when there is none

 

The decimal separator defines how to display the fractional part of a number. A comma indicates that a value must be divided by a thousand, for each comma, after the format's digits.

Regardless of Windows Region and Language configurations, dots and commas must be used on the format's text, to indicate the thousands and decimal separators, but the formatted output complies with system's regional configurations. The next table describes all available options.

Available options

Data

Format

Formatted Output

12000

#,

12

1234567

#,#.0

1,234,567.0

Was this page useful?