### NumericText (str)

NumericText and IsNumeric (str) are equivalent functions. However, NumericText is preferred in Crystal syntax, whereas IsNumeric is preferred in Basic syntax.

##### Arguments

str is a text string being tested for numeric text.

##### Returns

Boolean Value

##### Action

NumericText tests to see if the content of a text object is a Number.

- If the entire content of the field is a Number - or if the characters extracted via the Subscript for arrays and strings are entirely a Number - the function returns a TRUE value.
- If any part of the content of the field - or of the characters extracted - are not a Number, the function returns the value FALSE.

##### Typical uses

If you store numbers (like weight) in a text object, use NumericText to check the value of each record to make sure it is OK to convert using ToNumber (numeric), ToNumber (string).

##### Examples

The following examples are applicable to both Basic and Crystal syntax, although IsNumeric is preferred in the latter:

`NumericText({file.REFERENCE})`

Returns FALSE where {file.REFERENCE} = "ABCDEFG".

`NumericText({file.IDNUM})`

Returns TRUE where {file.IDNUM} = "12345".

`NumericText({file.IDNUM})`

Returns TRUE where {file.IDNUM} = "12345443".

`NumericText({file.IDNUM})`

Returns FALSE where {file.IDNUM} = "12345-443".

`NumericText ({file.IDNUM} [1 to 5])`

Returns TRUE where {file.IDNUM} = "12345-443".

`NumericText ({file.IDNUM} [6])`

Returns FALSE where {file.IDNUM} = "12345-443".

`NumericText ({file.IDNUM} [7 to 9])`

Returns TRUE where {file.IDNUM} = "12345-443".

`NumericText({file.IDNUM})`

Returns FALSE where {file.IDNUM} = "12345T".

Note: You can use this function in combination with ToNumber (numeric), ToNumber (string) to test for a Number in the Reference field, then print the string as a Number or print 0 if the text string is not a Number.

The following example is applicable to Crystal syntax:

If NumericText({file.REFERENCE}) Then
ToNumber({file.REFERENCE})
Else
0;

###### Related topics

Formula 9

Seagate Software, Inc. http://www.seagatesoftware.com Please send comments to: techpubs@seagatesoftware.com