ConstrainedInt
Extends:
The purpose of ConstrainedInt is to store an imprecise numerical value, which conforms to a number of acceptable validation rules. The value will be confined between a minimum and a maximum. The value will be truncated (not rounded) to the allowed precision of digits past the decimal. It has an acceptable incrementing step property to use for driving UI controls so it's easier to modify the value within the expected precision. The default value is 0.
Constructor Summary
Public Constructor | ||
public |
constructor(dataName: string, dataItemProps: object) Constructor |
Member Summary
Public Members | ||
public |
Function that returns the current allowed precision of the data item. |
|
public |
Function that returns the current maximum allowable value for the data item. |
|
public |
Function that returns the current minimum allowable value for the data item. |
|
public |
Function that returns the current default increment and decrement step of the value for the data item. |
|
public |
setAllowedPrecision(val: number): * Function that changes the current allowed precision of the data item. |
|
public |
Function that changes the current maximum allowable value for the data item. |
|
public |
Function that changes the current minimum allowable value for the data item. |
|
public |
Function that returns the current default increment and decrement step of the value for the data item. |
Public Constructors
public constructor(dataName: string, dataItemProps: object) source
Constructor
Params:
Name | Type | Attribute | Description |
dataName | string | The name of the data item. |
|
dataItemProps | object |
|
An object of properties such as hidden, disabled, suppressed etc. |
dataItemProps.min | number |
|
The minimum allowable value for the data item. |
dataItemProps.max | number |
|
The maximum allowable value for the data item. |
dataItemProps.step | number |
|
The value to increment or decrement by for driving UI controls bound to this data item. |
dataItemProps.allowedPrecision | number |
|
The number of digits allowed on the right side of the decimal point. |
Public Members
public getAllowedPrecision: number: * source
Function that returns the current allowed precision of the data item. Allowed precision dictates the number of digits allowed on the right side of the decimal point for the value of this data item. The value will be truncated (not rounded) to this number of digits of precision.
public getMax: number: * source
Function that returns the current maximum allowable value for the data item.
public getMin: number: * source
Function that returns the current minimum allowable value for the data item.
public getStep: number: * source
Function that returns the current default increment and decrement step of the value for the data item.
public setAllowedPrecision(val: number): * source
Function that changes the current allowed precision of the data item. Allowed precision dictates the number of digits allowed on the right side of the decimal point for the value of this data item. The value will be truncated (not rounded) to this number of digits of precision.
public setMax(val: number): * source
Function that changes the current maximum allowable value for the data item.