11.07.2015 Views

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

Caché ObjectScript Reference - InterSystems Documentation

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>Caché</strong> <strong>ObjectScript</strong> Functions$NUMBERValidates and returns a numeric value; optionally provides rounding and range checking.$NUMBER(num,format,min,max)$NUM(num,format,min,max)ParametersnumformatminmaxThe numeric value to be validated and then converted to <strong>Caché</strong> canonicalform. It can be a numeric or string value, a variable name, or any valid<strong>Caché</strong> <strong>ObjectScript</strong> expression.Optional — Specifies which processing options to apply to num. Theseprocessing options dictate primarily how to recognize and handle numberscontaining decimal points.Optional — The minimum acceptable numeric value.Optional — The maximum acceptable numeric value.DescriptionThe $NUMBER function converts and validates the num numeric value using the specifiedformat. It accepts numbers supplied with a variety of punctuation formats and returns numbersin <strong>Caché</strong> canonical form. If min or max are specified, the number must fall within that rangeof values.The $DOUBLE values INF, –INF, and NAN are always returned unmodified, regardless ofthe values of the format, min, or max parameters.ParametersformatThe possible format codes are as follows. These format codes may be specified in any order.A non-numeric format must be specified as a quoted string. Any or all of the following formatcodes may be omitted. If format is invalid, $NUMBER generates a error.• Decimal character: either “.” or “,” indicating whether to use the American (“.”) orEuropean (“,”) convention for validating the decimal point. You can specify either ofthese characters, or no decimal character. If you omit the decimal character, the numbertakes the DecimalSeparator of the current locale.272 <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!