FORMAT_NUMBER

Help Contents

Introduction

Formats a numeric value using a custom format.

Syntax

Informal Syntax:

FORMAT_NUMBER( In, Format )

Formal Syntax:

FORMAT_NUMBER( In:=expression, Format:=expression )

Parameters

ParameterTypeDescription
In ANY_NUM The input value to convert to a string.
Format ANY_STRING The format pattern to apply to the In value. See Number Format for information on how to create format patterns.

Return Value

The function FORMAT_NUMBER returns the In parameter formatted using the Format parameter. See Number Format for information on how to create format patterns.

The type of the return value matches the type of the Format parameter. For example if the Format parameter is a STRING, the return value will be a STRING.

Examples

ExampleReturn Value
FORMAT_NUMBER( 10000, '0.00e00' )STRING#'1.00e05'

Standards Compliance

The function FORMAT_NUMBER is an extension to the IEC 61131-3 standard.

Further Information

Conversion Functions

To learn about other Conversion Functions.

Number Format

To learn about pattern strings for number formats.

String Literals

To learn about string literals and the different types of encoding used.

Common Elements

To learn about other IEC 61131-3 Common Elements.

Glossary

For the meaning of terms used in Fernhill SCADA.