ComponentOne True DBInput Pro 8.0
DecimalPlaces Property (TDBNumLite)

 

Reference> TDBNumLite Control> TDBNumLite Control Properties> DecimalPlaces Property (TDBNumLite)

DecimalPlaces Property (TDBNumLite)

The DecimalPlaces property is used in combination with the IntegerPlaces property to limit the digits that can be entered in the control.

Syntax

TDBNumLite.DecimalPlaces= integer

Read/Write at run time and design time.

Values

0 - 14 (0 is the default)

Remarks

The DecimalPlaces property is used in combination with the IntegerPlaces property to limit the digits that can be entered in the control. The valid ranges for the integral and the decimal places both put together must not exceed 0 to 15 digits. Changing the value of this property will automatically adjust the IntegerPlaces property to fit the left over digits only if exceeding. For example, setting the DecimalPlaces to 5 will adjust the IntegerPlaces to 10, only if the original number of integral digits were larger than 10.

When both the DecimalPlaces and the IntegerPlaces properties are set to 0, the valid range will allow any combination of the integral and the decimal number of digits, just so they are within 15 digits. For example, entering 5 digits of integral places and pressing the decimal point character will preserve the left over 10 digits for the decimal places.

If a floating-point value is read from a database or set at run time and it contains more decimal digits than can be displayed, the control will maintain the precise value. However, only the number of digits specified with the DecimalPlaces property will be displayed in the control. If the integral digits exceed the specified number of digits, the value will be handled as an invalid value. For example:

TDBNumLite.IntegerPlaces = 5

TDBNumLite.DecimalPlaces = 3

TDBNumLite.Value = 123.12345

With the example above, the underlying value will hold - "123.123". Setting a value such as "123456.123" will cause an invalid error since the integral places exceed the specified number of digits.

Changing the value of either the DecimalPlaces or the IntegerPlaces property will cause the underlying value to set to Null. The user would need to initialize the value after specifying the number of digits.

The value of the integral and the decimal places can be referenced with the Integer and the Decimal properties.

See Also

IntegerPlaces Property (TDBNumLite)

Decimal Property (TDBNumLite)

Integer Property (TDBNumLite)

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback