Formatting Numbers

The Format group for the various types of number fields (integer,long,real,unsigned char,signed char) contains some or all of the following fields:

Precision

(For real type fields only) Enter the number of decimal places to display.

Scale factor

(For real type fields only) Display-only for database fields. For non-database fields that are real numbers, you use it to determine how fields are stored and processed, as opposed to how they are displayed. The aim is to store numbers as integers to minimise rounding errors. On storage, numbers are multiplied by the power of 10 corrsposding to their scale factor. On display, they are divided by the corresponding power of 10. For example:

PrecisionScale factorDisplayed asStored as
3351.35651356
3051.35651.356
2351.3651356

As a rule of thumb, set the scale factor to the same value as the precision. Occasionally, you may want to set the scale factor higher than the precision, for example in currency translations. Be aware that if you set the scale factor lower than the precision, the number is not stored as an integer, which defeats the purpose of using scale factors.

Use default values

Enable this to accept the default formatting values for the field. These are derived from the user preferences.

Before decimal point

Enable this to insert the separator between thousands before the decimal point. Disable it to display no separator before the decimal point

After decimal point

Enable this to insert the separator between thousands after the decimal point. Disable it to display no separator after the decimal point

Separator

Enter the character to be used for separating thousands (groups of three digits). This is normally a comma (,) in the UK and USA and a period (.) in continental Europe

Units

Select the unit, if any, whose symbol you want to display. (Increase the length of the field to accommodate the symbol)

Cash till input

Enable this to specify that numbers are entered as for cash registers, for example:1.00 is entered as 100, 0.01 is entered as 1

Standard

Enable this to display negative values in the normal way, for example −3.7

Trailing sign

Enable this to display negative values with a trailing minus sign, for example −3.7 displays as 3.7−

In parentheses

Enable this to display negative values enclosed in parentheses, for example −3.7 displays as (3.7)

Blank if zero

Enable this to display nothing for zero values, for example, "0" displays as " "

Blank leading

Enable this to display nothing for leading zeros. This is primarily zeros intended for echoing typed characters during cash till input. For example, 0.37 displays as .37

Decimal point

Enter the decimal point character you want. This is normally a period (.) in the USA and UK and a comma (,) in continental Europe

Pad with asterisks

Enable this to replace spaces with asterisks (*). This is useful in cheque printing, for example: 0.37 appears as ****0.37 in a field of length 8

Validation

For non database fields you can set up explicit validation ranges and a default value for the field (possibly used to initialise the edit feidl if the Clear First property is set). If you don't enable validation DP4 will use 0 as the default value, and create suitable low and high values based on the input field type and length.

Database fields are always range-validated and defaulted using the data dictionary validation.

Low High

For non-database fields, enter the lowest/highest values permitted for the field. DP4 uses these values to validate field entry.

Default

For non-database fields, enter the value to offer as a default for field entry.