General formatting
general-formatting-switch:\* [ " ] switch-argument [ " ]
A general-formatting-switch specifies a variety of formats for a numeric or text result. If the result type of a field does not correspond to the format specified, this switch has no effect.
Quotation marks are required around switch-argument if it contains white space; otherwise, they are optional.
A switch-argument is made up of a series of picture items.
General Formatting Switch Arguments |
|
---|---|
Switch Argument |
Description |
AIUEO |
Formats a numeric result using hiragana characters in the traditional a-i-u-e-o order.
example: :
.]1 \* AIUEO results in Corresponds to an ST_NumberFormat enumeration value of |
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.
example: :
=54 \* ALPHABETIC results in "BBB" as subtracting 26 from 54 two times, results in the value 2, which is represented by the letter B. |
alphabetic |
Formats a numeric result as one or more occurrences of an 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.
example: :
=52 \* alphabetic results in "zz " as subtracting 26 from 52 one time, results in the value 26, which is represented by the letter z.. |
Arabic |
Formats a numeric result using Arabic cardinal numerals.
example: : For page 123,
PAGE \* Arabic results in "123 ".Corresponds to an ST_NumberFormat enumeration value of |
ARABICABJAD |
Formats a numeric result using ascending Abjad numerals.
example: :
.]12 \* ARABICABJAD results in Corresponds to an ST_NumberFormat enumeration value of |
ARABICALPHA |
Formats a numeric result using characters in the Arabic alphabet.
example: :
.]12 \* ARABICABJAD results in Corresponds to an ST_NumberFormat enumeration value of |
ArabicDash |
Formats a numeric result using Arabic cardinal numerals, with a prefix of "- " and a suffix of " -".
example: : For page 123,
PAGE \* ArabicDash results in "- 123 - ".Corresponds to an ST_NumberFormat enumeration value of |
BAHTTEXT |
Formats a numeric result using the given Thai style.
example: :
.]1 \* BAHTTEXT results in |
Caps |
Capitalizes the first letter of each word.
example: :
USERNAME "mary smith" \* Caps results in " ", whereasUSERNAME "marysmith" \* Caps results in "Marysmith ". |
CardText |
Formats a numeric result as lowercase cardinal text.
example: : For page 123,
PAGE \* CardText results in "one hundred twenty-three ".Corresponds to an ST_NumberFormat enumeration value of |
CHARFORMAT |
See the discussion following this table. |
CHINESENUM1 |
Formats a numeric result using ascending numbers from the Chinese counting system.
example: :
.]10 \* CHINESENUM1 results in Corresponds to an ST_NumberFormat enumeration value of |
CHINESENUM2 |
Formats a numeric result using sequential numbers from the Chinese simplified legal format.
example: :
.]123 \* CHINESENUM2 results in Corresponds to an ST_NumberFormat enumeration value of |
CHINESENUM3 |
Formats a numeric result using sequential numbers from the Chinese counting thousand system.
example: :
.]10 \* CHINESENUM3 results in Corresponds to an ST_NumberFormat enumeration value of |
CHOSUNG |
Formats a numeric result using sequential numbers from the Korean Chosung format.
example: : 1
.] \* CHOSUNG results in Corresponds to an ST_NumberFormat enumeration value of |
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. For non-negative numbers outside this range, formats them as with
ARABIC . example: :
.]12 \* CIRCLENUM results in Corresponds to an ST_NumberFormat enumeration value of |
DBCHAR |
Formats a numeric result using double-byte Arabic numbering.
example: :
.]123 \* DBCHAR results in Corresponds to an ST_NumberFormat enumeration value of |
DBNUM1 |
Formats a numeric result using sequential digital ideographs, using the appropriate character.
example: :
.]12 \* DBNUM1 results in Corresponds to an ST_NumberFormat enumeration value of |
DBNUM2 |
Formats a numeric result using sequential numbers from the Korean counting system.
example: :
.]12 \* DBNUM2 results in Corresponds to an ST_NumberFormat enumeration value of |
DBNUM3 |
Formats a numeric result using sequential numbers from the Japanese legal counting system.
example: :
.]12 \* DBNUM3 results in Corresponds to an ST_NumberFormat enumeration value of |
DBNUM4 |
Formats a numeric result using sequential numbers from the Japanese digital ten thousand counting system.
example: :
.]12 \* DBNUM4 results in Corresponds to an ST_NumberFormat enumeration value of |
DollarText |
Formats a numeric result in the following form: integer-part-as-cardinal-text The fractional part is rounded to two decimal places, nn, and is formatted using Arabic cardinal numerals.
example: :
=1234.567 \* DollarText results in "one thousand two hundred thirty-four and 57/100 ". |
FirstCap |
Capitalizes the first letter of the first word.
example: :
USERNAME "mary smith" \* FirstCap results in "Mary smith ". |
GANADA |
Formats a numeric result using sequential numbers from the Korean Ganada format.
example: :
.]12 \* GANADA results in Corresponds to an ST_NumberFormat enumeration value of |
GB1 |
Formats a numeric result using decimal numbering followed by a period, using the enclosed alphanumeric glyph character.
example: :
.]12 \* GB1 results in Corresponds to an ST_NumberFormat enumeration value of |
GB2 |
Formats a numeric result using decimal numbering enclosed in parenthesis, using the enclosed alphanumeric glyph character.
example: :
.]12 \* GB2 results in Corresponds to an ST_NumberFormat enumeration value of |
GB3 |
Formats a numeric result using decimal numbering enclosed in a circle, using the enclosed alphanumeric glyph character. Once the specified sequence reaches 11, the numbers may be replaced with non-enclosed equivalents.
example: :
.]12 \* GB3 results in Corresponds to an ST_NumberFormat enumeration value of |
GB4 |
Formats a numeric result using decimal numbering enclosed in a circle, using the enclosed alphanumeric glyph character. Once the specified sequence reaches 11, the numbers may be replaced with non-enclosed equivalents.
example: :
.]12 \* GB4 results in Corresponds to an ST_NumberFormat enumeration value of |
HEBREW1 |
Formats a numeric result using Hebrew numerals.
example: :
.]123 \* HEBREW1 results in Corresponds to an ST_NumberFormat enumeration value of |
HEBREW2 |
Formats a numeric result using the Hebrew alphabet.
example: :
.]123 \* HEBREW2 results in Corresponds to an ST_NumberFormat enumeration value of |
Hex |
Formats the numeric result using uppercase hexadecimal digits.
example: : For page 355,
PAGE \* Hex results in "FF ".Corresponds to an ST_NumberFormat enumeration value of |
HINDIARABIC |
Formats a numeric result using Hindi numbers.
example: :
.]123 \* HINDIARABIC results in Corresponds to an ST_NumberFormat enumeration value of |
HINDICARDTEXT |
Formats a numeric result using sequential numbers from the Hindi counting system.
example: :
.]123 \* HINDICARDTEXT results in Corresponds to an ST_NumberFormat enumeration value of |
HINDILETTER1 |
Formats a numeric result using Hindi vowels.
example: :
.]123 \* HINDILETTER1 results in Corresponds to an ST_NumberFormat enumeration value of |
HINDILETTER2 |
Formats a numeric result using Hindi consonants.
example: :
.]123 \* HINDILETTER2 results in Corresponds to an ST_NumberFormat enumeration value of |
IROHA |
Formats a numeric result using the Japanese iroha.
example: :
.]12 \* IROHA results in Corresponds to an ST_NumberFormat enumeration value of |
KANJINUM1 |
Formats a numeric result using a Japanese style using sequential digital ideographs, using the appropriate character.
example: :
.]12 \* KANJINUM1 results in |
KANJINUM2 |
Formats a numeric result using the Japanese counting system.
example: :
.]12 \* KANJINUM2 results in Corresponds to an ST_NumberFormat enumeration value of |
KANJINUM3 |
Formats a numeric result using the Japanese legal counting system.
example: :
.]12 \* KANJINUM3 results in |
Lower |
All letters are lowercase.
example: :
USERNAME "Mary Smith" \* Lower results in "mary smith ". |
MERGEFORMAT |
See the discussion following this table. |
Ordinal |
Formats a numeric result using lowercase ordinal Arabic numerals.
example: :
=32 \* Ordinal results in "32nd ".Corresponds to an ST_NumberFormat enumeration value of |
OrdText |
Formats a numeric result as lowercase ordinal text. Apart from being used to round off the whole number part, the fractional part is not used.
example: :
=1234.567 \* OrdText results in "one thousand two hundred thirty-fifth ".Corresponds to an ST_NumberFormat enumeration value of |
Roman |
Formats a numeric result using uppercase Roman numerals.
example: : For page 123,
PAGE \* Roman results in "CXXIII ".Corresponds to an ST_NumberFormat enumeration value of |
roman |
Formats a numeric result using lowercase Roman numerals.
example: : For page 123,
PAGE \* roman results in "cxxiii ".Corresponds to an ST_NumberFormat enumeration value of |
SBCHAR |
Formats a numeric result using single-byte Arabic numbering.
example: :
.]123 \* SBCHAR results in Corresponds to an ST_NumberFormat enumeration value of |
THAIARABIC |
Formats a numeric result using Thai numbers.
example: :
.]123 \* THAIARABIC results in Corresponds to an ST_NumberFormat enumeration value of |
THAICARDTEXT |
Formats a numeric result using sequential numbers from the Thai counting system.
example: :
.]123 \* THAICARDTEXT results in Corresponds to an ST_NumberFormat enumeration value of |
THAILETTER |
Formats a numeric result using Thai letters.
example: :
.]123 \* THAILETTER results in Corresponds to an ST_NumberFormat enumeration value of |
Upper |
All letters are uppercase.
example: :
USERNAME "Mary Smith" \* Upper results in " ". |
VIETCARDTEXT |
Formats a numeric result using Vietnamese numerals.
example: :
.]12 \* VIETCARDTEXT results in Corresponds to an ST_NumberFormat enumeration value of |
ZODIAC1 |
Formats a numeric result using sequential numerical traditional ideographs.
example: :
.]1 \* ZODIAC1 results in Corresponds to an ST_NumberFormat enumeration value of |
ZODIAC2 |
Formats a numeric result using sequential zodiac ideographs.
example: :
.]1 \* ZODIAC2 results in Corresponds to an ST_NumberFormat enumeration value of |
ZODIAC3 |
Formats a numeric result using sequential traditional zodiac ideographs.
example: :
.]1 \* ZODIAC3 results in Corresponds to an ST_NumberFormat enumeration value of |
CHARFORMAT
is used to set the visual appearance of a field's value by setting the first run in that field's field-type name to the desired state using any of the elements that can be directly nested inside the run property element, <rPr>
. DATE \* CHARFORMAT
results in "1/4/2006". However, if the D
in DATE
is made bold, the field DATE \* CHARFORMAT
results in "1/4/2006". If that D
is made italic, the field DATE \* CHARFORMAT
results in "1/4/2006". If that D
is made bold, underlined, and red, the field DATE \* CHARFORMAT
results in "1/4/2006". The XML for the bold, underlined, red case is as follows:
<w:r> <w:fldChar w:fldCharType="begin"/> </w:r> <w:r> <w:instrText xml:space="preserve"> </w:instrText> </w:r> <w:r …> <w:rPr> <w:b/> <w:color w:val="ED1C24"/> <w:u w:val="single"/> </w:rPr> <w:instrText>D</w:instrText> </w:r> <w:r> <w:instrText xml:space="preserve">ATE </w:instrText> </w:r> <w:r> <w:fldChar w:fldCharType="separate"/> </w:r> <w:r …> <w:rPr> <w:b/> <w:color w:val="ED1C24"/> <w:u w:val="single"/> </w:rPr> <w:t>1/4/2006</w:t> </w:r> <w:r> <w:fldChar w:fldCharType="end"/> </w:r>
\* Lower
is also used, that switch is ignored. MERGEFORMAT
is used to apply formatting directly to part of a result such that when that result is updated, the formatting is preserved. The formatting is expressed in XML using an <rPr>
element on the run that contains the most recently updated field result. TIME \@ "HH:mm:ss" \* MERGEFORMAT
When it is updated, the result might be 12:22:27
, for example. If the seconds part of the displayed field result is underlined, as in 12:22:
27, when that field is next updated, the seconds underlining is preserved. If MERGEFORMAT
is omitted, the <rPr>
element on the run that contains the most recently updated field result is ignored.
The XML generated for this is:
<w:r> <w:fldChar w:fldCharType="begin"/> </w:r> <w:r> <w:instrText xml:space="preserve"> TIME \@ "HH:mm:ss" \* MERGEFORMAT </w:instrText> </w:r> <w:r> <w:fldChar w:fldCharType="separate"/> </w:r> <w:r …> <w:t>17:02:</w:t> </w:r> <w:r …> <w:rPr> <w:u w:val="single"/> </w:rPr> <w:t>32</w:t> </w:r> <w:r> <w:fldChar w:fldCharType="end"/> </w:r>