MONEYTOA C-3

NAME

moneytoa - convert MONEY to ASCII

SYNOPSIS

#include <cbase/dtypes.h>

char *moneytoa (m)

MONEY m;

DESCRIPTION

Moneytoa converts the MONEY value m to its ASCII string representation and returns a pointer to that string with all leading blanks removed. The format returned by getfmoney(C-3) provides the format to convert the MONEY value.

The operand is a MONEY value expressed in the basic unit of currency (i.e., pennies for U.S.A. values). Moneytoa first converts the value to a string and then formats the number with the system format, inserting the decimal place character at the appropriate point. This method guarantees that there are no rounding errors when converting a floating point MONEY value to its character string representation.

SEE ALSO

getfmoney(C-3), fmoneytoa(C-3), atomoney(C-3)

C/Base Reference Manual Chapter 13, "Formatting Data Values"

DIAGNOSTICS

If the format is invalid, a pointer to an empty string is returned.

NOTES

The return value points to static data whose contents are overwritten with every call.