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

AVEVA™ Work Tasks

SFU​.isNumber()

  • Last UpdatedJun 25, 2024
  • 1 minute read

Use isNumber() method to determine if a value from a string or number is number.

Syntax

bRetVal = SFU.isNumber(value, acceptEmptyString);

Parameters

Parameter

Description

value

Value to check.

acceptEmptyString

Pass as true to consider an empty string as number.

This parameter is optional.

Return Value

This method returns a boolean value.

Example

// Check if the value from the string is number.

var valControl = control.findById("T1").value;

var valNumber = SFU.isNumber(valControl);

// Return true if value contains "123" or 123.

// Returns false if value contains "12A3" or ""

// Check if a value from the string is empty and consider it as number.

var valControl = control.findById("T1").value;

var valNumber = SFU.isNumber(valControl,true);

// Returns true if value contains "123", 123,or "".

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