Converts an integer to a string using a defined number base.
Informal Syntax:
Formal Syntax:
FORMAT_INTEGER( Value:=expression, Base:=expression )
Parameter | Type | Description |
---|---|---|
Value | ANY_INT | The input value to convert to a string. |
Base | ANY_INT | The number base to use in the conversion. Use any value in the range 2 to 16. Values less than 2 are rounded up to 2. Values more than 16 are rounded down to 16. |
The function FORMAT_INTEGER returns the Value parameter converted to a STRING. The conversion uses a number base defined by the Base parameter.
Example | Return Value |
---|---|
FORMAT_INTEGER( 1000, 2 ) | STRING#'1111101000' |
FORMAT_INTEGER( 1000, 5 ) | STRING#'13000' |
FORMAT_INTEGER( 1000, 8 ) | STRING#'1750' |
FORMAT_INTEGER( 1000, 10 ) | STRING#'1000' |
FORMAT_INTEGER( 1000, 16 ) | STRING#'3E8' |
The function FORMAT_INTEGER is an extension to the IEC 61131-3 standard.
To learn about other Conversion Functions.
To learn about string literals and the different types of encoding used.
To learn about other IEC 61131-3 Common Elements.
For the meaning of terms used in Fernhill SCADA.