Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.5d

Application v 5.25a

  

 

Chapter FiveGeneral Functions (continued)

IsNumeric Function

Overview

The IsNumeric function tests if a string contains only numeric characters or if it is a number with associated financial or real number syntax.

Syntax/Parameters

Syntax

boolean = IsNumeric ( string value, [dword options] );

Parameters

value

A string to test.

options

An optional dword that specifies the test conditions for value. The default value is 0x00000000.

Return Value

Returns a boolean value as TRUE if value contains only numeric characters or FALSE if it does not. Use the GetLastError function to retrieve statistics on the tested value.

Remarks

In default mode, the IsNumeric function provides strict checking in that the entire string must be composed of numeric digits.

The options allow for the number to test if the value parameter is real numbers or as financial numbers. The following options are available:

  Define   Bitwise   Description  
  Mode          
    IS_NUM_MODE_MASK   0x0000000F   Mode Mask Type  
    IS_NUM_MODE_US   0x00000000   US Mode  
  Input Constraints          
    IS_NUM_DIGITS_ONLY   0x00000000   Only Digits (default)  
    IS_NUM_ALLOW_ALL   0x000000F0   Cover All Modes  
    IS_NUM_ALLOW_DECIMAL   0x00000010   Allow Decimal (US format)  
    IS_NUM_ALLOW_COMMAS   0x00000020   Allow Commas (US format)  
    IS_NUM_ALLOW_NEG_DASH   0x00000040   Allow Negative as -  
    IS_NUM_ALLOW_NEG_HOLE   0x00000080   Allow Negative as ()  
  Output Results          
    IS_NUM_HAS_DECIMAL   0x00100000   Has Decimal  
    IS_NUM_HAS_COMMAS   0x00200000   Has Commas  
    IS_NUM_HAS_NEG_DASH   0x00400000   Has Negative as -  
    IS_NUM_HAS_NEG_HOLE   0x00800000   Has Negative as ()  

 

The output results are placed in the last error value. Note that if the function returns FALSE, some output bits may not be set.

Only the US locale is supported at this time. Decimals must have a trailing digit. Commas require a leading digit and trailing three digits in the form of n.nnn.

Only ‘-’ or parenthesis may be used for negative values but not both.

Use the HasNumeric function to test if the string contains one or more numeric characters.

Related Functions

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic