Number Format

Help Contents

Introduction

Numbers are important SCADA attributes that informs the operator about the state of their equipment. You can use custom Number Format patterns to change the way numbers are displayed.

Number Format Pattern Characters

A custom Number Format consists of a pattern of characters:

CharacterDescription
0 A placeholder for a digit. The digit is always shown.
# A placeholder for a digit. Leading and trailing zeros are not shown.
. A full stop is the placeholder for the decimal point. (For example 0.00).
, A comma is the group separator for thousands. (For example #,##0).
E/e Displays the number in scientific notation. The pattern before the 'E' or 'e' is used for the mantissa. The pattern after the 'E' or 'e' is used for the exponent.
+ Always display a sign character in the exponent. (For example 0.00e+00).
; The pattern separator. The pattern before the ';' is used for positive numbers. The pattern after the ';' is used for negative numbers.
' Used to include special characters in the prefix or suffix.

Characters not listed in the above table are copied directly to the output.

Where to Use Number Formats

You can use Number Format strings in these areas:

Examples

These examples show how number format patterns change the way numbers are displayed:

Number Pattern Result Comment
12.59 #.## 12.59
12.59 #.# 12.6 Value is rounded up
12.59 # 13
12.0 #.## 12
12.0 #.00 12.00
12.0 $#.00 $12.00 The '$' prefix appears before the number.
12.0 #.00 litres 12.00 litres The ' litres' suffix appears after the number.
50000 # 50000
50000 '#'# #50000 The quote character escapes the first '#'.
50000 #,### 50,000 The ',' comma character is used to group digits. In this case thousands.
50000 0.00E0 5.00E5 The 'E' character forces scientific notation.
50000 0.0e+0 5.0e+5 The '+' always displays the sign of the exponent.
50000 ##0.0e+00 50.000e+03 An exponent format with more than 1 pattern character before the full stop rounds the exponent. In this case the exponent is rounded to a multiple of 3.
-50,000 #,### -50,000 The default way of displaying negative numbers uses a minus sign '-'.
-50,000 #,###;(#,###) (50,000) The second format pattern after the ';' is used for negative numbers.
50,000 +#,###;-#,### +50,000 To force the display of '+' or '-' use two format strings separated by a ';'.

Further Information

Date and Time of Day Format

To learn how for format dates and times.

Fernhill SCADA Concepts

To learn about other Fernhill SCADA Concepts.

FORMAT_NUMBER()

To learn how to format numbers in IEC 61131-3 code.

Glossary

For the meaning of terms used in Fernhill SCADA.