Money types

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:

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 for more information about these formats.

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:

The cs_cmp routine can be called to compare money values.