When using ActiveX Data Objects to access databases, one of the supported data-types for columns is a decimal. This can hold integers as well as floating point numbers to a precision greater than that offered by the Integer or Real Carapace types.
The create function can be used to create a Decimal
object. The following three statements all create decimals:
(create Decimal 33.3)
(create Decimal "33.3")
(create Decimal 33)
More commonly, a Decimal is returned by selecting data from
a database where the column type is decimal.
The Decimal object supports the following methods:
| method name | description |
|---|---|
string |
return a string representation of the decimal |
integer |
convert the decimal to an Integer -- since an Integer cannot hold the same precision as a decimal, this conversion may fail |
real |
convert the decimal to a Real -- since an Real cannot hold the same precision as a decimal, information may be lost |
fill |
fill the decimal from the supplied data |
stringReturn a string representation of the decimal.
Arguments: none
Return type: String
integerConvert the decimal to an Integer -- since an Integer cannot hold the same precision as a decimal, this conversion may fail.
Arguments: none
Return type: Integer
realConvert the decimal to a Real -- since an Real cannot hold the same precision as a decimal, information may be lost.
Arguments: none
Return type: Real
fillFill the decimal from the supplied data. The data can be supplied as a String, Integer or Real
Arguments:
| data | Object |
Return type: the empty List ()
is returned.
| Contents | Index | Current topic: objects | Related topics: functions |