Open Client supports two money datatypes, CS_MONEY and CS_MONEY4. These datatypes are intended to hold 8-byte and 4-byte money values, respectively:
CS_MONEY corresponds to the Adaptive Server Enterprise money datatype, with legal values between -$922,337,203,685,477.5807 and +$922,337,203,685,477.5807.
CS_MONEY4 corresponds to the Adaptive Server Enterprise smallmoney datatype, with legal values between -$214,748.3648 and +$214,748.3647.
An application can call the CS-Library routine cs_convert to initialize a money type from a character string. The cs_convert routine recognizes all of the money formats valid for Transact-SQL money character strings. See “Datatypes” in the Adaptive Server Enterprise Reference Manual.
The cs_convert routine can also convert a CS_MONEY or CS_MONEY4 value into a character string.
Money values cannot be manipulated with standard C operators because they are stored in structures. To perform arithmetic operations on money values, an application can either:
Call the CS-Library routine cs_calc to perform the arithmetic operation, or
Call cs_convert to convert the money type to a datatype with a standard C equivalent (such as CS_FLOAT).
The cs_cmp routine can be called to compare money values.