11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>Caché</strong> <strong>ObjectScript</strong> FunctionsParametersnumThe number to be validated may be an integer, a decimal number, an exponential number(with the letter “E” or “e”). It may be a string, expression, or variable that resolves to anumber. It may be signed or unsigned, and may contain leading or trailing zeros. Validationfails ($ISVALIDNUM returns 0) if:• num contains any characters other than the digits 0–9, a leading + or – sign, a decimalpoint (.), and the letter “E” or “e” indicating an exponent.• num contains more than one + or – sign, decimal point, or letter “E” or “e”.• The optional + or – sign is not the first character of num.• The letter “E” or “e” indicating an exponent is not followed by an integer in a numericstring. With a number, “E” not followed by an integer results in a error.• num is the null string.• num is the INF or NAN value returned by $DOUBLE.The scale parameter value causes evaluation using rounded or truncated versions of the numvalue. The actual value of the num variable is not changed by $ISVALIDNUM processing.scaleThe scale parameter is used during range checking to specify how many decimal digits tocompare. Specify an integer value for scale; decimal digits in the scale value are ignored.You can specify a scale value larger than the number of decimal digits specified in the otherparameters. You can specify a scale value of –1; all other negative scale values result in a error.A non-negative scale value causes num to be rounded to that number of decimal digits beforeperforming min and max range checking. A scale value of 0 causes num to be rounded to aninteger value (3.9 = 4) before performing range checking. A scale value of –1 causes num tobe truncated to an integer value (3.9 = 3) before performing range checking. To compare allspecified digits without rounding or truncating, omit the scale parameter. A scale value whichis non-numeric or the null string is equivalent to a scale value of 0.Rounding is performed for all scale values except –1. A value of 5 or greater is always roundedup.If you omit the scale parameter, retain the comma as a place holder.232 <strong>Caché</strong> <strong>ObjectScript</strong> <strong>Reference</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!