MGH_STR_ISNUMBER
ROUTINE NAME:
MGH_STR_ISNUMBER Purpose
Determine whether a string represents a valid number.
Category
Strings.
Calling Sequence
result = MGH_STR_ISNUMBER(str) Arguments
str (input, string scalar or array)
The string to be tested. Keywords
TYPE (input, numeric scalar)
This keyword specifies the numeric data type to which the string
is to be converted. It is passed to the FIX function to carry
out the conversion. The default is 5 (double). For a list of IDL
data types see the documentation for the SIZE function.
VALUE (output, double)
Set this keyword to a named variable to return the value. The
data type is as specified by the TYPE keyword. The shape is the
same as the input.
Return Value
The function returns a byte scalar or array with the same
shape as the input. The value is 1B if the string has been
successfully converted to a number, otherwise 0B.
###########################################################################
This software is provided subject to the following conditions:
1. NIWA makes no representations or warranties regarding the
accuracy of the software, the use to which the software may
be put or the results to be obtained from the use of the
software. Accordingly NIWA accepts no liability for any loss
or damage (whether direct of indirect) incurred by any person
through the use of or reliance on the software.
2. NIWA is to be acknowledged as the original author of the
software where the software is used or presented in any form.
###########################################################################
Modification History
Mark Hadfield, 2001-05:
Written, based on STRNUMBER in the IDL Astronomy Library.
Mark Hadfield, 2002-01:
Added the TYPE keyword to control the numeric type.