[Table of Contents] [docx version]

WordprocessingML Reference Material - Table of Contents

Numeric formatting

numeric-formatting-switch:
\# [ " ] switch-argument [ " ]

A numeric-formatting-switch specifies the format of a numeric result. If the result of a field is not a number, this switch has no effect.

Quotation marks are required around switch-argument if it contains white space; otherwise, they are optional.

If no numeric-formatting-switch is present, a numeric result is formatted without leading spaces or trailing fractional zeros. If the result is negative, a leading minus sign is present. If the result is a whole number, no radix point is present.

A numeric switch-argument is made up of a series of picture items.

Numeric Formatting Picture Items

Picture Item

Description

0

Specifies the requisite numeric positions to display in the result. If the result does not include a digit in that position, 0 is displayed. [Example: In a US-English context, =4+5 \# 00.00 displays "09.00". end example]

#

Specifies the requisite numeric positions to display in the result. If the result does not include a digit in that position, a space is displayed. Extra fractional digits are rounded off. [Example: =9+6 \# $### displays "$ 15". end example]

x

Drops digits to the left of the x placeholder. If the placeholder is to the right of the decimal point, the result is rounded to that place. [Example: In a US-English context, =111053+111439 \# x## displays "492", =1/8 \# 0.00x displays "0.125", and =3/4 \# .x displays ".8". end example]

.

Indicates the radix-point position. [Example: In a US-English context, =95.4 \# $###.00 displays "$ 95.40. end example] The radix-point character displayed is locale-specific.

,

Separates groups of three digits. [Example: In a US-English context, =2456800 \# $#,###,### displays "2,456,800". end example] The separator character displayed is locale-specific.

-

Prepends a minus sign to a negative result, or prepends a space if the result is positive or 0. [Example: =80-90 \# -## displays "-10", while =90-80 \# -## displays " 80". end example]

+

Prepends a plus sign to a positive result, a minus sign to a negative result, or a space if the result is 0. [Example: =90-80 \# +## displays "+10", and =80-90 \# +## displays "-10". end example]

Other character

Includes the specified character in the result at that position. [Example: =33 \# ##% displays "33%". end example]

'text'

Includes text in the result. [Example: In a US-English context, if Price is a bookmark for 26.5, =Price*15% \# "##0.00 'is the sales tax'" displays "$  3.98 is the sales tax". end example]

`numbered-item`

 

Includes, in Arabic numerals, the number of the preceding item numbered as a caption or resulting from a SEQ field (§2.16.5.63). numbered-item shall be the same name as identifier in that SEQ field. [Example: =SUM(A1:D4) \# "##0.00 'is the total of Table' `table`" displays "456.34 is the total of Table 2". end example]

positive-result ; negative-result

Specifies different sets of picture items for positive and negative results. A zero value uses the positive picture. [Example: =Sales95 \# $#,##0.00;-$#,##0.00 displays that bookmark's positive values using $#,##0.00, and it's negative values using -$#,##0.00. end example]

positive-result ; negative-result ; zero-result

Specifies different sets of picture items for positive, negative, and zero results. [Example: =Sales95 \# $#,##0.00;-$#,##0.00;$0 displays that bookmark's positive values using $#,##0.00, it's negative values using -$#,##0.00, and its zero values using $0. end example]