dbmnyndigit

Description

Return the rightmost digit of a DBMONEY value as a DBCHAR.

Syntax

RETCODE dbmnyndigit(dbproc, mnyptr, value, zero)
 
DBPROCESS     *dbproc;
DBMONEY         *mnyptr;
DBCHAR            *value;
DBBOOL             *zero;

Parameters

dbproc

A pointer to the DBPROCESS structure that provides the connection for a particular front-end/server process. It contains all the information that DB-Library uses to manage communications and data between the front end and the server.

This parameter may be NULL. The DBPROCESS is used as a parameter to an application’s error handler. It also contains information on what language to print error messages in. If a DBPROCESS is not supplied, the default national language is used.

mnyptr

A pointer to a DBMONEY value. Each call to dbmnyndigit divides this value by 10 and places the result back into *mnyptr.

value

A pointer to a DBCHAR variable to fill with the character representation of the rightmost digit of the DBMONEY value.

zero

A pointer to a DBBOOL variable. Each call to dbmnyndigit divides *mnyptr by 10 and puts the character representation of the remainder of the division in *value. If the result of the division is $0.0000, dbmnyndigit sets *zero to “true”. Otherwise, *zero is set to “false”. If zero is passed as NULL, this information is not returned.

Returns

SUCCEED or FAIL.

dbmnyndigit returns FAIL if mnyptr or value is NULL.

Usage

See also

dbconvert, dbmnyinit