Skip to main content

%Library.Numeric

datatype class %Library.Numeric extends %Library.DataType

ODBC Type: NUMERIC

The %Numeric data type class represents a fixed point number.

Method Inventory

Parameters

parameter DISPLAYLIST;
Used for enumerated (multiple-choice) attributes. Used in conjunction with the VALUELIST parameter for enumerated (multiple-choice) attributes. DISPLAYLIST, if not null, represents the display values for the attribute corresponding with the logical values listed in VALUELIST.

The display values are returned by the LogicalToDisplay method.

parameter FORMAT;
The format specification for the data type's display value.

The value of FORMAT corresponds to the formatting option of the $FNUMBER function, which is used to perform the formatting. It is also possible to specify FORMAT = "AUTO" which means no formatting (otherwise the display value will be padded with zeroes up to the specified scale).

parameter JSONTYPE = number;
JSONTYPE is JSON type used for this datatype.
parameter MAXVAL;
The maximum allowed logical value for the data type.
parameter MINVAL;
The minimum allowed logical value for the data type.
parameter SCALE = 2;
The scale value (number of digits following the decimal point) for this data type. The logical value will be rounded to the specified number of decimal places.
parameter VALUELIST;
Used for enumerated (multiple-choice) attributes. VALUELIST is either a null string ("") or a delimiter separated list (where the delimiter is the first character) of logical values. If a non-null value is present, then the attribute is restricted to values in the list, and the validation code simply checks to see if the value is in the list.
parameter XMLFractionDigits;
The number of fractional digits for XML verification as defined by http://www.w3.org/TR/xmlschema-2/#rf-fractionDigits
parameter XMLTotalDigits;
The total number of digits for XML verification as defined by http://www.w3.org/TR/xmlschema-2/#rf-totalDigits
parameter XSDTYPE = decimal;
Declares the XSD type used when projecting XML Schemas.

Methods

classmethod DisplayToLogical(%val As %String) as %Numeric
Converts the input value %val, which is a string representing a numeric (fixed point) value, into a logical numeric value.

Returns the value of the input string %val as a fixed point number.

classmethod IsValid(%val As %RawString) as %Status
Tests if the logical value %val, which is a numeric value, is valid. The validation is based on the class parameter settings used for the class attribute this data type is associated with. In this case, MAXVAL and MINVAL.
classmethod LogicalToDisplay(%val As %Numeric) as %String
Converts the value of %val, which is in logical format, into a display string.

Returns the string value of %val.

classmethod LogicalToJSON(%val As %Numeric) as %String
Converts the Objectscript value to the JSON number value.
classmethod LogicalToXSD(%val As %Numeric) as %String
Converts the %Numeric value to the canonical SOAP encoded value.
classmethod Normalize(%val As %RawString) as %Numeric
Converts %val to a normalized value.
classmethod XSDToLogical(%val As %String) as %Numeric
Converts the SOAP encoded input decimal value into a %Numeric value. Returns "" for error.

Subclasses

FeedbackOpens in a new tab