Formatting Functions

To format a variant into a string you must first tokenize the format string and then apply the format on that string. The 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 formatting functions.

In this section

TopicDescription

VarFormat

Formats a variant into string form by parsing a format string.

VarFormatCurrency

Formats a variant containing currency values into a string form.

VarFormatDateTime

Formats a variant containing named date and time information into a string.

VarFormatFromTokens

Takes a tokenized format string and applies it to a variant to produce a formatted output string.

VarFormatNumber

Formats a variant containing numbers into a string form.

VarFormatPercent

Formats a variant containing percentages into a string form.

VarMonthName

Returns a string containing the localized month name.

VarTokenizeFormatString

Parses the actual format string into a series of tokens which can be used to format variants using VarFormatFromTokens.

VarWeekdayName

Returns a string containing the localized name of the weekday.

 

 

 

Show: