Enable/Disable Decimal Check Option

PURPOSE:  DECIMAL CHECK controls the precision required on new or replacement data entered into N (numeric), V (virtual), and R (real) data fields.  This command is valid in a CM, PM, SF and as a direct command.

SYNTAX

{ENABLE; DISABLE} DECIMAL CHECK [{IF; UNLESS} clause]

ENABLE

requires that the entered value have exactly the number of decimal places specified in the field definition.  This is the default state.

DISABLE

allows the entered value to have more or fewer decimal places than are specified in the field definition.  If the entered value has fewer decimal places, ACCENT R supplies zeros.  If the entered value has more decimal places, ACCENT R rounds the value.

{IF; UNLESS} clause

specifies certain criteria that must be met for the ENABLE or DISABLE command to take effect.

EXAMPLE

With DECIMAL CHECK disabled, a field defined as N (numeric), 7, 2 would accept the entered values:

1.444 as 1.44
1.4452 as 1.45
17 as 17.00

With DECIMAL CHECK enabled, an attempt to store any of these three values into a field with two decimal places would fail.

DECIMAL CHECK does not apply to literals in a SET command or an assignment statement in a PM.

NOTES:  ENABLE/DISABLE DECIMAL CHECK affects data entered through the ENTER command, the CHANGE command, and the ACCEPT statement.  System functions @RND and @TRUNC can also be used as another means of adjusting values before storing.

SEE ALSO:  ENTER, CHANGE, ACCEPT and @RND, @TRUNC - System Functions