Windows apps
Collapse the table of content
Expand the table of content

Formatting Routines [Automation]

To format a variant into a string you must first tokenize the format string and then apply the format on that string. The API level formatting functions can be used to apply the format in one step and to apply the same format repeatedly. For example, you can call the VarFormat function to apply the formatting at once. If you are going to apply the same format over again you can call VarTokenizeFormatString and use the tokens from VarFormatFromTokens repeatedly. The following table describes the API level formatting routines:

Functions

Description

VarTokenizeFormatString

Parses the actual format string into a series of tokens.

VarFormat

Formats a variant into string form by using the user's default locale while calling VarTokenizeFormatString and VarfFormatFromTokens.

VarFormatDateTime

Formats a variant using named date and time format into a string.

VarFormatNumber

Formats a variant containing numbers into a string form.

VarFormatPercent

Formats a variant containing percentages into a string form.

VarFormatCurrency

Formats a variant containing currency values into a string form.

VarWeekdayName

Returns a string containing the localized weekday name.

VarMonthName

Returns a string containing the localized month name.

VarFormatFromTokens

Takes the output of VarTokenizeFormatString and applies it to a variant to produce a formatted output string.

Show:
© 2017 Microsoft