Skip to main content

Number Schema Type

The number schema type allows you to work with numeric values.

Schema Definition Properties

In addition to the base schema definition properties the number type has the following additional properties:

PropertyTypeMandatoryDefaultDescription
type"number"✔️The type literal for a number schema type
dbDecimalsnumber0If specified, decimal values will be converted to and from MultiValue internal format using this number of implied decimal places

Formatting

A number schema type will be formatted based upon the value of the dbDecimals property in the definition. For instance, if you had a dbDecimals value of 2, the following formats would be applied:

Database ValueJavaScript Value
12345123.45

Example

const schemaDefinition = {
numberProperty: {
type: 'number',
path: 1,
dictionary: 'NUMBER_DICT',
dbDecimals: 2,
},
};

const schema = new Schema(schemaDefinition);