17.16.4.3.1 General formatting - Numeric Values
The following switch-arguments apply to fields whose field result is a numeric value. If the result type of the field is not numeric, then these switches have no effect. If the field result varies based on the language of the field instructions, those variations are noted inline:
- Switch Argument
AIUEO
ALPHABETIC
alphabetic
Arabic
ARABICABJAD
ARABICALPHA
ArabicDash
BAHTTEXT
General Formatting Switch Arguments
Description
Formats a numeric result using hiragana characters in the traditional a-i-u-e-o order. [Example: 1 * AIUEO results in ア. end example] Corresponds to an ST_NumberFormat enumeration value of aiueoFullWidth.
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, producesthe value 2, which is represented by the letter B. end example] Corresponds to an ST_NumberFormat value of upperLetter.
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, produces the value 26, which is represented by the letter z.. end example] Corresponds to an ST_NumberFormat enumeration value of lowerLetter.
Formats a numeric result using Arabic cardinal numerals. [Example: For page 123, PAGE * Arabic results in “123”. end example] Corresponds to an ST_NumberFormat enumeration value of decimal.
Formats a numeric result using ascending Abjad numerals. [Example: 12 * ARABICABJAD results in ل. end example] Corresponds to an ST_NumberFormat enumeration value of arabicAbjad.
Formats a numeric result using characters in the Arabic alphabet. [Example: 12 * ARABICABJAD results in س. end example] Corresponds to an ST_NumberFormat enumeration value of arabicAlpha.
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 -”. end example] Corresponds to an ST_NumberFormat enumeration value of numberInDash.
Formats a numeric result in the following form: - If the value is an integer, it is displayed using the . Thai counting system, with บาทถวน ้ appended to the result. - If the value includes a fractional value, the fractional part is rounded to two decimal places, and the resulting value is displayed in the form integer-part-in-Thai-counting format บาท fractional-part-in-Thai- counting format สตางค.์ [Example: 1 * BAHTTEXT results in หนึ ่งบาทถ้วน. end example]
General Formatting Switch Arguments
CardText
CHINESENUM1
CHINESENUM2
CHINESENUM3
CHOSUNG
CIRCLENUM
DBCHAR
DBNUM1
DBNUM2
DBNUM3
Corresponds to an ST_NumberFormat enumeration value of bahtText.
Formats a numeric result as lowercase cardinal text. [Example: For page 123, PAGE * CardText results in “one hundred twenty-three”. end example] Corresponds to an ST_NumberFormat enumeration value of cardinalText.
Formats a numeric result using ascending numbers from the appropriate counting system. [Example: 10 * CHINESENUM1 results in 十. end example] Corresponds to an ST_NumberFormat enumeration value of chineseCounting (zh-CN) or taiwaneseCounting (zn-TW).
Formats a numeric result using sequential numbers from the appropriate legal format. [Example: 123 * CHINESENUM2 results in 壹佰貳拾參. end example] Corresponds to an ST_NumberFormat enumeration value of chineseLegalSimplified (zh-CN) or ideographLegalTraditional (zh-TW).
Formats a numeric result using sequential numbers from the appropriate counting thousand system. [Example: 10 * CHINESENUM3 results in 一百二十 三. end example] Corresponds to an ST_NumberFormat enumeration value of chineseCountingThousand (zh-CN) or taiwaneseCountingThousand (zh-TW).
Formats a numeric result using sequential numbers from the Korean Chosung
format. [Example: 1 * CHOSUNG results in ㄱ. end example] Corresponds to an ST_NumberFormat enumeration value of chosung.
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 ⑫. end example] Corresponds to an ST_NumberFormat enumeration value of decimalEnclosedCircle.
Formats a numeric result using double-byte Arabic numbering. [Example: 123 * DBCHAR results in 123. end example] Corresponds to an ST_NumberFormat enumeration value of decimalFullWidth.
Formats a numeric result using sequential digital ideographs, using the appropriate character. [Example: 12 * DBNUM1 results in 一二. end example] Corresponds to an ST_NumberFormat enumeration value of ideographDigital (ja-JP) or koreanDigital (ko-KR).
Formats a numeric result using sequential numbers from the appropriatecounting system. [Example: 12 * DBNUM2 results in 十二. end example] Corresponds to an ST_NumberFormat enumeration value of japaneseCounting (ja-JP) or koreanCounting (ko-KR).
Formats a numeric result using sequential numbers from the appropriate legal counting system. [Example: 12 * DBNUM3 results in 壱拾弐. end example] Corresponds to an ST_NumberFormat enumeration value of japaneseLegal
DBNUM4
DollarText
GANADA
GB1
GB2
GB3
GB4
HEBREW1
HEBREW2
General Formatting Switch Arguments
(ja-JP) or koreanLegal (ko-KR).
Formats a numeric result using sequential numbers from the appropriate digital counting system. [Example: 12 * DBNUM4 results in 一二. end example] Corresponds to an ST_NumberFormat enumeration value of japaneseDigitalTenThousand (ja-JP) or koreanDigital2 (ko-KR) or taiwaneseDigital (zh-TW).
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, nn, and is formatted using Arabic cardinal numerals. [Example: =1234.567 * DollarText results in “one thousand two hundred thirty-four and 57/100”. end example] Corresponds to an ST_NumberFormat enumeration value of dollarText.
Formats a numeric result using sequential numbers from the Korean Ganada format. [Example: 12 * GANADA results in 타. end example] Corresponds to an ST_NumberFormat enumeration value of ganada.
Formats a numeric result using decimal numbering followed by a period, using the enclosed alphanumeric glyph character. [Example: 12 * GB1 results in ⒓. end example] Corresponds to an ST_NumberFormat enumeration value of decimalEnclosedFullstop.
Formats a numeric result using decimal numbering enclosed in parenthesis, using the enclosed alphanumeric glyph character. [Example: 12 * GB2 results in ⑿. end example] Corresponds to an ST_NumberFormat enumeration value of decimalEnclosedParen.
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 can be replaced with non-enclosed equivalents. [Example: 12 * GB3 results in 12. end example] Corresponds to an ST_NumberFormat enumeration value of decimalEnclosedCircleChinese.
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 can be replaced with non-enclosed equivalents. [Example: 12 * GB4 results in 12. end example] Corresponds to an ST_NumberFormat enumeration value of ideographEnclosedCircle.
Formats a numeric result using Hebrew numerals. [Example: 123 * HEBREW1 results in גכק. end example] Corresponds to an ST_NumberFormat enumeration value of hebrew1.
Formats a numeric result using the Hebrew alphabet. [Example: 123 * HEBREW2 results in מתתתתת. end example]
General Formatting Switch Arguments
Corresponds to an ST_NumberFormat enumeration value of hebrew2.
Hex
HINDIARABIC
HINDICARDTEXT
HINDILETTER1
HINDILETTER2
IROHA
KANJINUM1
KANJINUM2
KANJINUM3
Ordinal
OrdText
Formats the numeric result using uppercase hexadecimal digits. [Example: For page 355, PAGE * Hex results in “FF”. end example] Corresponds to an ST_NumberFormat enumeration value of hex.
Formats a numeric result using Hindi numbers. [Example: 123 * HINDIARABIC results in १२३. end example] Corresponds to an ST_NumberFormat enumeration value of hindiNumbers.
Formats a numeric result using sequential numbers from the Hindi counting system. [Example: 123 * HINDICARDTEXT results in एक सौ तईस. े end example] Corresponds to an ST_NumberFormat enumeration value of hindiCounting.
Formats a numeric result using Hindi vowels. [Example: 123 * HINDILETTER1 results in ठठठठ. end example] Corresponds to an ST_NumberFormat enumeration value of hindiVowels.
Formats a numeric result using Hindi consonants. [Example: 123 * HINDILETTER2 results in ओओओओओओओ. end example] Corresponds to an ST_NumberFormat enumeration value of hindiConsonants.
Formats a numeric result using the Japanese iroha. [Example: 12 * IROHA results in オ. end example] Corresponds to an ST_NumberFormat enumeration value of irohaFullWidth.
Formats a numeric result using a Japanese style using the appropriate counting system. [Example: 12 * KANJINUM1 results in 一二. end example] Corresponds to an ST_NumberFormat enumeration value of koreanDigital (ko-KR), ideographDigital (ja-JP), chineseCounting (zh-CN), or taiwaneseCounting (zh-TW).
Formats a numeric result using the appropriatecounting system. [Example: 12 * KANJINUM2 results in 十二. end example] Corresponds to an ST_NumberFormat enumeration value of koreanCounting (ko-KR), chineseCountingThousand (ja-JP), chineseLegalSimplified (zh-CN), or ideographLegalTraditional (zh-TW).
Formats a numeric result using the appropriatecounting system. [Example: 12 * KANJINUM3 results in 壱拾弐. end example] Corresponds to an ST_NumberFormat enumeration value of koreanLegal (ko- KR) or japaneseLegal (ja-JP) or chineseCountingThousand (zh-CN) or taiwaneseCountingThousand (zh-TW).
Formats a numeric result using lowercase ordinal Arabic numerals. [Example: =32 * Ordinal results in “32nd”. end example] Corresponds to an ST_NumberFormat enumeration value of ordinal.
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:
Roman
roman
SBCHAR
THAIARABIC
THAICARDTEXT
THAILETTER
VIETCARDTEXT
ZODIAC1
ZODIAC2
ZODIAC3
General Formatting Switch Arguments
Formats a numeric result using uppercase Roman numerals. [Example: For page 123, PAGE * Roman results in “CXXIII”. end example] Corresponds to an ST_NumberFormat enumeration value of upperRoman.
Formats a numeric result using lowercase Roman numerals. [Example: For page 123, PAGE * roman results in “cxxiii”. end example] Corresponds to an ST_NumberFormat enumeration value of lowerRoman.
Formats a numeric result using single-byte Arabic numbering. [Example: 123 * SBCHAR results in 123. end example] Corresponds to an ST_NumberFormat enumeration value of decimalHalfWidth.
Formats a numeric result using Thai numbers. [Example: 123 * THAIARABIC results in ๑๒๓. end example] Corresponds to an ST_NumberFormat enumeration value of thaiNumbers.
Formats a numeric result using sequential numbers from the Thai counting system. [Example: 123 * THAICARDTEXT results in หนึ ่งรอ้ยยสี่บสาม. ิ end example] Corresponds to an ST_NumberFormat enumeration value of thaiCounting.
Formats a numeric result using Thai letters. [Example: 30 * THAILETTER results in ฮฮฮม. end example] Corresponds to an ST_NumberFormat enumeration value of thaiLetters.
Formats a numeric result using Vietnamese numerals. [Example: 12 * VIETCARDTEXT results in mười hai. end example] Corresponds to an ST_NumberFormat enumeration value of vietnameseCounting.
Formats a numeric result using sequential numerical traditional ideographs. [Example: 1 * ZODIAC1 results in 甲. end example] Corresponds to an ST_NumberFormat enumeration value of ideographTraditional.
Formats a numeric result using sequential zodiac ideographs. [Example: 1 * ZODIAC2 results in 子. end example] Corresponds to an ST_NumberFormat enumeration value of ideographZodiac.
Formats a numeric result using sequential traditional zodiac ideographs. [Example: 1 * ZODIAC3 results in 甲子. end example] Corresponds to an ST_NumberFormat enumeration value of ideographZodiacTraditional.
The following switch-arguments apply to
fields whose field result is a string value:
General Formatting Switch Arguments
- Switch Argument
Description
Caps
FirstCap
Lower
Upper
Capitalizes the first letter of each word. [Example: USERNAME “mary smith” * Caps results in “Mary Smith”, whereas USERNAME “marysmith” * Caps results in “Marysmith”. end example]
Capitalizes the first letter of the first word. [Example: USERNAME “mary smith” * FirstCap results in “Mary smith”. end example]
All letters are lowercase. [Example: USERNAME “Mary results in “mary smith”. end example]
All letters are uppercase. [Example: USERNAME “Mary results in “MARY SMITH”. end example]
The following switch-arguments apply to any field result, and provide directions to applications regarding the formatting which should be applied to a field result after a field update has been performed. As discussed in 17.16, as to when a field update is performed is outside the scope of ISO/IEC 29500.
The general formatting switch argument CHARFORMAT is an instruction that specifies formatting intended for application to the field result after a field update. If this switch is present, the formatting of the run containing the first instrText element after the fldChar element with a fldCharType attribute value of begin is applied to all runs in the field result whenever a new field result is generated. [Example: In a US-English context, on January 4, 2006, the field DATE * CHARFORMAT results in “1/4/2006”. However, if the first run within the field instructions (containing the D in DATE) is bold, the field DATE * CHARFORMAT results in “1/4/2006”. If that D is italic, the field DATE * CHARFORMAT results in “1/4/2006”. If that D is 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:t>1/4/2006</w:t>
</w:r>
<w:r>
<w:fldChar w:fldCharType="end"/>
</w:r>
Then use of the CHARFORMAT switch would cause the new field result to reuse the formatting on the first run in the field instructions, like this:
<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 /* CHARFORMAT</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>
end example]
If a format specified directly in the first run of a field’s field-type name conflicts with a general formatting switch, the general formatting switch is ignored. [Example: If the first run is set in small caps and the switch * Lower is also used, that switch is ignored. end example]
The general formatting switch argument MERGEFORMAT is used to specify an instruction regarding the formatting which is applied to the field result after a field update. If this switch is present, it specifies that applications that perform field updates should preserve the formatting of the existing field result when a new field result is generated, by applying the following logic:
- Delete all text from the current field result (leaving the paragraph and run structure intact).
- Insert the new field result text into the existing run/paragraph structure.
If the new text does not fill the existing structure, delete the superfluous runs/paragraphs. If the new text overflows the existing structure, add additional runs/paragraphs as needed.
[Example: Consider the following field:
TIME \@ "HH:mm:ss"
When it is updated, the result might be 12:22:27, for example. If the seconds part of the displayed field result was underlined by the use of direct formatting within the original WordprocessingML, as in 12:22:27, when that field is next updated, the seconds underlining is preserved.
If the original XML generated for this
field is:
<w:r>
<w:fldChar w:fldCharType="begin"/>
</w:r>
<w:r>
<w:instrText xml:space="preserve"> TIME
</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>
then use of the MERGEFORMAT switch would cause the new field result to reuse that structure, like this:
<w:r>
<w:fldChar w:fldCharType="begin"/>
</w:r>
<w:r>
<w:instrText>TIME \@ "HH:mm:ss" \* MERGEFORMAT</w:instrText>
</w:r>
<w:r>
<w:fldChar w:fldCharType="separate"/>
</w:r>
<w:r …>
<w:t>12:22:</w:t>
</w:r>
<w:r …>
<w:rPr>
<w:u w:val="single"/>
</w:rPr>
<w:t>27</w:t>
</w:r>
<w:r>
<w:fldChar w:fldCharType="end"/>
</w:r>
and omitting it would direct an application that it could replace it with a single new run, like this:
<w:r>
<w:fldChar w:fldCharType="begin"/>
</w:r>
<w:r>
<w:instrText>TIME \@ "HH:mm:ss"</w:instrText>
</w:r>
<w:r>
<w:fldChar w:fldCharType="separate"/>
</w:r>
<w:r>
<w:t>12:22:27</w:t>
</w:r>
<w:r>
<w:fldChar w:fldCharType="end"/>
</w:r>
end example]