decimals

Type: Integer

Availability: Read or write at any time

The decimals property is used in conjunction with the dataType property to indicate whether the text in a TextBox control is a Decimal primitive type numeric.

If the dataType property is set to DataType_Currency (3), setting the decimals property to -1 indicates that the number of decimal places for currency defined by the current locale is used. To manually control how many decimal places are allowed, set the decimals property to a value other than -1.

If the dataType property is set to DataType_Numeric (1) or DataType_SignedNumeric (2), the decimals property indicates the maximum number of decimal places that the numeric value can have. The numeric text is validated as each character is entered. If the result of the assignment results in an invalid numeric as defined by the dataType property, the character that is entered is rejected.

If the case property is set to any value other than the default value of Case_None (0), the dataType property is set to the default value of DataType_AlphaNumeric (0) and the decimals property is set to zero (0); that is, no exception is raised.

Use the decimals property for the Table class to specify that a cell controlled by the accessMode, accessedSheet, accessedRow, accessedColumn, or accessedCell property can accept decimal input when the value of the inputType property is set to InputType_TextNumeric (4) or InputType_SignedNumeric (6).

Specify a value greater than zero (0) but less than the value of the maxLength property to specify the number of decimal places that numeric text in a table cell can have. Setting the decimals property to -1 indicates that decimals are allowed but no limit is imposed on the number of decimal places.

The value of the decimals property (if non-zero) cannot equal or exceed the value of the maxLength property if that is non-zero.

Setting the value of the decimals property is rejected if the current text in the text box does not conform to the rules defined by the current value of the dataType (for text box controls), inputType (for Table controls), decimals, and maxLength properties.