Format
- Last UpdatedJan 11, 2023
- 1 minute read
- PI System
- PI Server 2018
- PI Server
Convert a number to string according to a format expression.
Syntax
Format(x, format [,culture])
Arguments
-
x
An integer or a real number
-
format
Format-control string, similar to that used by the C language function Sprintf
-
culture
Optional. Culture name string, enclosed in double quotation marks. Example values include "de-DE", "ja-jp", "pt-br", "zh-cn". Use "" to specify the culture-invariant setting (the default setting).
Returns
A formatted string
Example
-
Format(1234.567, "%10.2f", "de-DE")
[Returns "1234,57", a formatted string]
-
Format(45, "%3.3d")
[Returns "045"]