Decimal numbers are arbitrary precision numbers which do not use an exponent multiplier as reals may. Unlike reals, decimals must include every single digit. This eliminates the rounding problems of Reals but increases storage requirements for large values. As a general rule, decimals are used for currency amounts.
Each decimal value has a precision and a scale. The scale is the number digits to the right of the decimal separator. The precision is the total number of significant digits.
unspecified as Decimal fixedScale as Decimal(2) fixedBoth as Decimal(5, 2)
In this example, unspecified is of arbitrary precision and scale, fixedScale can be any number with only two digits to the right of the decimal digit (e.g. 600000.25), and fixedBoth can hold only numbers with up to two digits to the right of the decimal point for a total of 5 digits.
display 12.3456780 to Decimal(2)
This example displays 12.35. Note that it rounds, and does not truncate, the original value.