About strings

Microsoft Office ShapeSheet

About strings

Formulas can contain strings. To format string output, such as in a prompt cell, a custom property value, or a text field, you specify a format picture. Output can be formatted as a number-unit pair, string, date-time, duration, or currency. For example, the format picture "0 #/10 uu" formats the number-unit pair 10.9cm as "10 9/10 centimeters".

You can use format pictures in the Format cell of the Custom Properties section and as an argument to the FORMAT or FORMATEX function. When you insert a text field, format pictures appear in the list of formats in the Field dialog box (on the Insert menu, click Field).

Click to show or hide information.Using functions to format strings

In any formula that resolves to a string, including custom text field formulas, you can use the FORMAT or FORMATEX function. The FORMAT function returns a string of the formatted output. The FORMATEX function converts untyped input to the units you choose for the formatted result.

Click to show or hide information.Displaying formatted custom properties

You can format the displayed value of a custom property by entering a format picture in the Format cell.

For example, a project timeline shape can have a custom property that measures the cost of a process. By default, a custom property value is a string. To format the string "1200", you can enter "$###,###.00" in the Format cell so that the user sees a currency.

Microsoft Visio uses the current Regional Settings in Control Panel to determine the currency symbol and thousands separator to display.

To convert a string to a currency value so that you can perform calculations with the value, use the CY function.