Language basics / Data types |
The MONEY data type is provided to store currency amounts with exact decimal storage.
MONEY [ (precision[,scale]) ]
The MONEY data type is provided to store currency amounts. Its behavior is similar to the DECIMAL data type, with some important differences:
A MONEY variable is displayed with the currency symbol defined in the DBFORMAT (or DBMONEY) environment variable.
You cannot define floating-point numbers with MONEY: If you do not specific the scale in the data type declaration, it defaults to 2. A MONEY without precision and scale defaults to MONEY(16,2), which is equivaltent to a DECIMAL(16,2).
Data type conversion can be controlled by catching the runtime exceptions. For more details, see Handling type conversion errors.
See DECIMAL(p,s) to learn other facts about the MONEY(p,s) data type.