Name
Currency Type
Syntax
type Currency;
Description
The Currency
type is a 64-bit fixed-point type, with
four places after the decimal point. The Currency
type uses the floating-point processor, treating the
Currency value as an integer. Input and output
using the Currency type imposes the four-decimal
place convention, and computation using Currency
automatically adjusts the value by 10,000 to account for the implicit
decimal places.
Tips and Tricks
To use the full 64-bit precision of the
Currencytype, the floating-point control word must be set to extended precision. Some Microsoft and other DLLs change the floating-point control word to double or single precision, thereby reducing theCurrencytype to 54 or fewer bits.Delphi’s I/O and the formatting routines in the
SysUtilsunit do not support the full range of theCurrencytype. Values near the limits of theCurrencytype are printed with less precision than is actually stored in theCurrencyvariable. Most applications will not encounter this limitation.
See Also
| Extended Type, Int64 Type, Set8087CW Procedure |
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access