General Format Switch
- 5 minutes to read
Syntax
\* [ “ ] switch-argument [ “ ]
A general formatting switch specifies formats for a numeric or text result. Quotation marks are required around a switch-argument if it contains a white space; otherwise, they are optional.
Arguments
The following switch arguments are supported.
Switch Argument | Description |
---|---|
ALPHABETIC | Formats a numeric result as one or more occurrences of an uppercase alphabetic Latin character. Value 1 results in the letter A, value 2 results in the letter B, and so on up to value 26, which results in the letter Z. For values greater than 26, 26 is repeatedly subtracted from the value until the result is 26 or less. The result value determines which letter to use, and the same letter is repeated for each time 26 was subtracted from the original value. For page 27, the field {PAGE * ALPHABETIC} results in “AA”, as subtracting 26 from 27 results in the value 1, which is represented by the letter A. |
alphabetic | Formats a numeric result as one or more occurrences of a lowercase alphabetic Latin character. Value 1 results in the letter a, value 2 results in the letter b, and so on up to value 26, which results in the letter z. For values greater than 26, 26 is repeatedly subtracted from the value until the result is 26 or less. The result value determines which letter to use, and the same letter is repeated for each time 26 was subtracted from the original value. For page 80, the field {PAGE * alphabetic} results in “bbbb” as subtracting 26 from 80 three times results in the value 2, which is represented by the letter b. |
arabic | Formats a numeric result using Arabic cardinal numerals. For page 123, PAGE * Arabic results in “123”. |
arabicdash | Formats a numeric result using Arabic cardinal numerals, with a prefix of “- “ and a suffix of “ -“. For page 123, PAGE * ArabicDash results in “- 123 -“. |
caps | Capitalizes the first letter of each word. |
cardtext | Formats a numeric result as lowercase cardinal text. For page 123, PAGE * CardText results in “one hundred twenty-three”. Number to text transformation is available for the following languages: English, French, German, Italian, Russian, Swedish, Turkish, Greek, Spanish, Portuguese, Ukrainian, Hindi. The language is determined by the culture of the current thread ( System.Threading.Thread.CurrentThread.CurrentCulture ). |
circlenum | Formats a numeric result using decimal numbering enclosed in a circle, using the enclosed alphanumeric glyph character for numbers in the range 1 - 20 (Unicode symbols 2460-2473). For non-negative numbers outside this range, formats them as with ARABIC. Note that the font used to display a filed should have corresponding glyphs in the specified positions. |
dbchar | Formats a numeric result using double-byte Arabic numbering. |
dbnum1 | Formats a numeric result using ideographic numbers for each digit in decimal representation. The Zero (0) is displayed using the character U+3007 (IDEOGRAPHIC NUMBER ZERO), while other digits are displayed using Chinese numbers from 1 to 9. |
dollartext | Formats a numeric result in the following form: integer-part-as-cardinal-text and nn/100. The fractional part is rounded to two decimal places and is formatted using Arabic cardinal numerals. The number 123.456 will be displayed as “one hundred twenty-three and 46/100”. The dollartext transformation is available for the following languages: English, French, German, Italian, Russian, Swedish, Turkish, Greek, Spanish, Portuguese, Ukrainian, Hindi. |
firstcap | Capitalizes the first letter of the first word. |
gb1 | Formats a numeric result using numbers with full stop Unicode characters. Numbers from 1 to 20 correspond to symbols from \u2488 to \u249B. |
gb2 | Formats a numeric result using parenthesized numbers. Numbers from 1 to 20 correspond to Unicode symbols from \u2474 to \u2487. |
gb3 | Formats a numeric result using parenthesized ideographs. Numbers from 1 to 10 correspond to Unicode symbols from \u3220 to \u3229. |
hex | Formats the numeric result using uppercase hexadecimal digits. For page 44, PAGE * Hex results in “2C” |
kanjinum1 | Formats a numeric result using Japanese sequential digital ideographs. |
lower | All letters are lowercase. |
MERGEFORMAT | When the field is updated and you apply formatting to the field result, that formatting is retained the next time the field is updated. Usually this works, but since formatting is dependent on the parts of a field result you apply formatting to, there are situations when this switch is unreliable. The following picture illustrates how the MERGEFORMAT switch works. The MERGEFIELD is bound to the list of writer names. After the field is updated, it shows the first name in the list. We paint the word Arthur red, and then move to the next data record. Red highlighting is retained. But if we paint the word Conan red, the highlighting will be lost after we navigate the data source to the next record and update the field. |
ordinal | Formats a numeric result using lowercase ordinal Arabic numerals. Ordinal conversion is available for the following languages: English, French, German, Italian, Russian, Swedish, Turkish, Greek, Spanish, Portuguese, Ukrainian. The language is determined by the culture of the current thread ( System.Threading.Thread.CurrentThread.CurrentCulture ) |
ordtext | Formats a numeric result as lowercase ordinal text. The fractional part is used to round off the whole number part and then discarded. Ordinal conversion is available for the following languages: English, French, German, Italian, Russian, Swedish, Turkish, Greek, Spanish, Portuguese, Ukrainian, Hindi. The language is determined by the culture of the current thread ( System.Threading.Thread.CurrentThread.CurrentCulture ). |
ROMAN | Formats a numeric result using uppercase Roman numerals. |
roman | Formats a numeric result using lowercase Roman numerals. |
sbchar | Formats a numeric result using common, single-byte Arabic numbering. |
upper | Capitalizes all letters. |
zodiac1 | Formats a numeric result using sequential numerical ideographs. |
zodiac2 | Formats a numeric result using sequential numerical ideographs. |
zodiac3 | Formats a numeric result using sequential numerical ideographs. |