Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Engineering

Format Function Details

  • Last UpdatedJan 28, 2025
  • 1 minute read

string Format (string pattern, object arg1, …)

The first argument is a pattern string into which the remaining arguments are substituted according to the format specifications included in the pattern string. This function follows the conventions defined for the .NET System.String.Format function.

The pattern string contains normal text with the argument formatting elements embedded within curly braces. For example:

Format('/{0}-{1}-{2:D3}', PREFIX of source, LETTER of source, NUMBER of source)

This example generates a name from the values of three attributes on the source object. The first two values are straightforward substitutions. The third value is substituted as an integer value with a minimum of 3 digits, padded with leading zeros if necessary, for example: "45" -> "045".

Another example of a format specifier is {3:F2}. In this example the fourth value is substituted as a number with two decimal digits, for example: "3456" is output as "3456.00".

For further information about format specifiers, refer to the Microsoft Learn article Standard numeric format strings for further information.

Related Links
TitleResults for “How to create a CRG?”Also Available in