About Format Pictures

A format picture is used to determine how a value is displayed. For example, you can control the number of digits displayed to the right or left of a decimal point, or whether a text string appears as uppercase or lowercase.

ms195651.vs_note(en-us,office.12).gif  Note
Microsoft Office Visio 2003 added support for Microsoft Office System date and time formatting. To define a date or time format picture by using Microsoft Office System formatting, enclose the format picture in double curly braces , for example, "{{m/d/yy}}". If you are using a predefined format, for example, 201, enclose it in curly braces and angle brackets, like this: "{<201>}"

The following tables show symbols you can use to format different types of values for display.

String and numeric values

Character Description

#

Digit placeholder. Displays either a digit or nothing. Leading and trailing zeros are not displayed. If more digits than placeholders are to the left of the decimal, all digits are displayed. If more digits than placeholders are to the right of the decimal, the fraction is rounded to the number of placeholders. For a dimension, if the placeholder is the leftmost digit, subunits that are 0 are not displayed.

For example, FORMAT(0ft 11.25in,"#.##u") displays 11.25in.

0

Digit placeholder (zero). Displays either a digit or nothing. Leading and trailing zeros are displayed. If more digits than placeholders are to the left of the decimal, all digits are displayed. If more digits than placeholders are to the right of the decimal, the fraction is rounded to the number of placeholders. For a dimension, subunits that are 0 are displayed.

For example, FORMAT(2ft 11.33in,"0.## u") displays 2 ft. 11.33 in.

.

Decimal placeholder. Determines how many digits are displayed to the left and right of the decimal position. In a multipart unit, the decimal is used in the smallest (rightmost) subunit. Displays the decimal character defined for the system's Regional and Language Options item (Control Panel).

For example, FORMAT(250 cm,"0.000 u") displays 250.000 cm.

,

Thousands separator. If surrounded by digit placeholders (# or 0), the separator separates thousands from hundreds within a number that has four or more digits to the left of the decimal. Displays the thousands separator defined for the system's Regional and Language Options item (Control Panel).

E- E+ e- e+

Scientific format. If the format contains at least one digit placeholder to the right of these symbols, the number is displayed in scientific format. Inserts the E or e between the number and its exponent. For E+ or e+, displays the plus (+) sign before positive exponents and the minus (-) sign before negative exponents. For E- or e-, displays the minus (-) sign only when the exponent is negative.

For example, FORMAT(12345.67,"###.#e+#") displays 123.5e+2.

u or U

Short label placeholder. Inserts abbreviated unit labels after each subunit. For example: in., ft., deg. The u placeholder inserts lowercase labels, and U inserts uppercase labels. Inserts the same number of spaces before the label as before the placeholder.

For example, FORMAT(12 c 13 d,"#u") displays 13c1.

uu or UU

Long label placeholder. Inserts unit labels after each subunit. For example: inches, feet, degrees. The u placeholder inserts lowercase labels, and U inserts uppercase labels. Inserts the same number of spaces before the label as before the placeholder.

For example, FORMAT(12.43in,"# #/4 UU") displays 12 2/4 INCHES.

uuu or UUU

Universal label placeholder. Inserts the universal (internal to Visio) form of unit labels after each subunit. The u placeholder inserts lowercase labels, and U inserts uppercase labels. Inserts the same number of spaces before the label as before the placeholder.

/

Fraction placeholder. Displays expression as a whole number with fraction if a leading digit placeholder is present. Otherwise, displays only the whole number in the numerator. If a number follows the digit placeholder in the denominator, rounds the fraction to the nearest fraction whose numerator is 1 and simplifies it. If a number is specified in the denominator without the digit placeholder, rounds to the nearest fraction but does not simplify it.

For example, FORMAT(12.43,"# #/4") displays 12 2/4.

space

Displays a space character in the formatted output. To display another character, use the backslash (\) character.

Currency values

Character Description

$

Currency symbol. Displays the currency symbol defined for the system's Regional and Language Options item (Control Panel).

u or U

Short label placeholder. Inserts the standard symbol for local currency or the three-character currency abbreviations for nonlocal currencies. For example, $99.00, 42.70 FRF. The u placeholder inserts lowercase or mixed-case labels, and U inserts uppercase labels.

uu or UU

Long label placeholder. Inserts long currency labels after each subunit. For example: U.S. dollar, French franc. The u placeholder inserts lowercase or mixed-case labels, and U inserts uppercase labels.

uuu or UUU

Universal label placeholder. Inserts the universal, three-character currency abbreviations for all currencies after each subunit. For example, 99.00 USD, 42.70 FRF. The u placeholder inserts lowercase labels, and U inserts uppercase labels. Inserts the same number of spaces before the label as before the placeholder.

Text values

Character Description

\

Displays the next character as is. To display the backslash character, type \\. See also "text".

"text" or 'text'

Displays the text enclosed in quotation marks as is. See also \ (backslash).

@

Text placeholder. Replaces a string if the value of an expression is a string.

For example, FORMAT("Hello", "'You entered ('@')'" ) results in "You entered (Hello)".

@+

Uppercase text placeholder. For string values, substitutes the input with uppercase.

For example, FORMAT("Hello", "@ @+ @-" ) results in "Hello HELLO hello)".

@-

Text placeholder. For string values, substitutes the input with lowercase. For example, FORMAT("Hello", "@ @+ @-" ) results in "Hello HELLO hello)".

Date values

Character Description

c or C

Date or time placeholder. Displays date and time values using a short (c) or long (C) date format, and the general time format. Visio versions 4.0 and earlier ignore this placeholder.

For example: FORMAT(DATETIME("6/25/07 12:05"),"C") displays Monday, June 25, 2007 12:05:00 PM. FORMAT(DATETIME("Jun. 25, 2007"),"c") displays 6/25/2007.

/

Date separator. If the expression is a date, separates the date components. Displays the date separator defined for the system in the Microsoft Office 2007 Language Settings dialog box (Start menu).

[ ]

Elapsed date placeholder. Used with the d, dd, w, and ww placeholders to display duration units.

For example, [d] or [dd] is elapsed days and [w] or [ww] is elapsed weeks.

d

Day placeholder. Displays the day as a number (1-31) without a leading zero.

dd

Day placeholder. Displays the day as a number (01-31) with a leading zero.

ddd or w

Short day of week placeholder. Displays the day as an abbreviation (Sun-Sat).

dddd or ww

Long day of week placeholder. Displays the day as a full name (Sunday-Saturday).

ddddd

Short date placeholder. Displays a date in the short form defined for the system's Regional and Language Options item (Control Panel).

dddddd

Long date placeholder. Displays a date in the long form defined for the system's Regional and Language Options item (Control Panel).

D

Day placeholder for Traditional Chinese. Displays the day of the month as the textual representation of the ordinal number. Locale-specific.

D_c

Day placeholder for Traditional Chinese. Displays the day of the month as the textual representation of the ordinal number. Independent of the user locale.

w_c or ww_c

Day placeholder for Traditional Chinese. Independent of the user locale.

w_e

Short day of week placeholder for English. Displays the day as an abbreviation (Sun-Sat). Independent of the user locale.

w_j

Short day of week placeholder for Japanese. Displays the day as an abbreviation. Independent of the user locale.

w_k

Short day of week placeholder for Korean. Displays the day as an abbreviation. Independent of the user locale.

w_s or ww_s

Day placeholder for Simplified Chinese. Independent of the user locale.

ww_e

Long day of week placeholder for English. Displays the day as a full name (Sunday-Saturday). Independent of the user locale.

ww_j

Long day of week placeholder for Japanese. Displays the day as a full name. Independent of the user locale.

ww_k

Long day of week placeholder for Korean. Displays the day as a full name. Independent of the user locale.

M

Month placeholder. Displays the month as a number (1-12) without a leading zero. See also m (minute placeholder).

MM

Month placeholder. Displays the month as a number (01-12) with a leading zero. See also mm (minute placeholder).

MMM

Month placeholder. Displays the month in abbreviated form (Jan-Dec).

MMMM

Month placeholder. Displays the full name of the month (January-December).

MMMM_c

Month placeholder for Traditional Chinese. Displays the full name of the month. Independent of the user locale.

MMMM_e

Month placeholder for English. Displays the full name of the month. Independent of the user locale.

yy

Year placeholder. Displays the year as a two-digit number (00-99).

yyyy

Year placeholder. Displays the year as a four-digit number (1900-2078).

g

Year placeholder. Locale-specific. For Japanese, displays short version for Gengo era. For Korean, displays Korean year label followed by a space.

g_j

Year placeholder. For Japanese, displays short version for Gengo era. Independent of user locale.

gg or G

Year placeholder. Locale-specific. For Traditional Chinese, displays short version for formal year label. For Japanese, displays short version for Gengo era in Kanji. For Korean, displays Korean year label followed by a space.

gg_c

Year placeholder. For Traditional Chinese, displays short version for formal year label. Independent of user locale.

gg_j

Year placeholder. For Japanese, displays short version for Gengo era in Kanji. Independent of user locale.

gg_k

Year placeholder. For Korean, displays Korean year label followed by a space. Independent of user locale.

ggg or GG

Year placeholder. Locale-specific. For Traditional Chinese, displays full version for formal year label. For Japanese, displays full version for Gengo era in Kanji. For Korean, displays Korean year label followed by a space.

ggg_c

Year placeholder. For Traditional Chinese, displays full version for formal year label. Independent of user locale.

ggg_j

Year placeholder. For Japanese, displays full version for Gengo era in Kanji. Independent of user locale.

e

Year placeholder. Locale-specific. For Traditional Chinese, displays string representing the Julian year. For Japanese, displays Gengo year as one or two digits and no leading zero. For Korean, displays the Korean year as a four-digit Arabic numeral.

e_c

Year placeholder. For Traditional Chinese, displays string representing the Julian year. Independent of user locale.

e_j

Year placeholder. For Japanese, displays Gengo year as a one- or two-digit Arabic numeral. Independent of user locale.

e_k

Year placeholder. For Korean, displays the Korean year as a four-digit Arabic numeral. Independent of user locale.

E

Year placeholder. Locale-specific. For Traditional Chinese, displays a string representing the republic year. For Japanese, displays Gengo year as one or two digits and no leading zero. For Korean, displays the Korean year as a four-digit Arabic numeral.

E_c

Year placeholder. For Traditional Chinese, displays a string representing the republic year. Independent of user locale.

ee

Year placeholder. Locale-specific. For Traditional Chinese, displays string representing the Julian year. For Japanese, displays Gengo year as a two-digit Arabic numeral with leading zero if needed. For Korean, displays the Korean year as a four-digit Arabic numeral.

ee_j

Year placeholder. For Japanese, displays Gengo year as a two-digit Arabic numeral. Independent of user locale.

EE

Year placeholder. Locale-specific. For Traditional Chinese, displays a string representing the republic year. For Japanese, displays Gengo year as a two-digit Arabic numeral with leading zero if needed. For Korean, displays the Korean year as a four-digit Arabic numeral.

n or N

Year placeholder. Locale-specific. For Traditional Chinese, displays the republic year as an Arabic numeral. For Japanese, displays Gengo year as one or two digits and no leading zero. For Korean, displays the Korean year as a four-digit Arabic numeral.

n_c

Year placeholder. For Traditional Chinese, displays the republic year as an Arabic numeral. Independent of user locale.

nn or NN

Year placeholder. Locale-specific. For Traditional Chinese, displays the republic year as an Arabic numeral. For Japanese, displays Gengo year as a two-digit Arabic numeral with leading zero if needed. For Korean, displays the Korean year as a four-digit Arabic numeral.

Time values

Character Description

:

Time separator. Displays the time defined for the system's Regional and Language Options item (Control Panel).

[ ]

Elapsed time placeholder. Used with the h, hh, m, mm, s, and ss placeholders to display duration units. For example, [h] or [hh] is elapsed hours, [m] or [mm] is elapsed minutes, and [s] or [ss] is elapsed seconds.

h

Hour placeholder. Displays the hour without a leading zero in 12-hour form (0-12).

hh

Hour placeholder. Displays the hour with a leading zero in 12-hour form (00-12).

H

Hour placeholder. Displays the hour without a leading zero in 24-hour form (0-24).

HH

Hour placeholder. Displays the hour with a leading zero in 24-hour form (00-24).

m

Minute placeholder. Displays the minutes without a leading zero (0-59).

mm

Minute placeholder. Displays the minutes with a leading zero (00-59).

s

Second placeholder. Displays the seconds without a leading zero (0-59).

ss

Second placeholder. Displays the seconds with a leading zero (00-59).

t

AM/PM abbreviation. Displays the abbreviation defined for the system's Regional and Language Options item (Control Panel).

tt

AM/PM designator. Displays the full designator defined for the system's Regional and Language Options item (Control Panel).

t_c or tt_c

Traditional Chinese AM/PM designator. Displays the designator. Independent of user locale.

t_k or tt_k

Korean AM/PM designator. Displays the designator. Independent of user locale.

t_j or tt_j

Japanese AM/PM designator. Displays the designator. Independent of user locale.

t_e

English AM/PM designator. Displays the short designator. Independent of user locale.

tt_e

English AM/PM designator. Displays the full designator. Independent of user locale.

t_s or tt_s

Simplified Chinese AM/PM designator. Displays the designator. Independent of user locale.

T

General time format.