Retys()

From Lianjapedia
Jump to: navigation, search

PURPOSE

Return a currency string

SYNONYM

api_ret_ys()

SYNOPSIS

#include "lianja_api.h"
 
int	_retys(string)
 
<input parameters>
char	*string;		/*Address of a buffer containing a character string	*/
 
<output parameters>
none

DESCRIPTION

The _retys() function returns a character string in the format "999999999999999.9999" as a currency type. The CURR_YTOS() function can be used to convert a currency value stored in a CURRENCY structure to a string format.

EXAMPLE

The following example evaluates the first parameter passed to a string and then returns the result.

Example Lianja script:

m_curr=$2873.89
m_curr=curr_con(m_curr)
return

Example 'C' function:

#include "lianja_api.h"
 
lianjaapi_curr_con()
{
    char	curr[21];
 
    if ( _parinfo(1) == API_YTYPE ) {
       strcpy( curr, _parys(1));
    } else {
       strcpy( curr, "");
    }
 
    _retys (curr );
}

SEE ALSO

_parc(), _parclen(), _parcsiz(), _parinfo(), _parys(), _retc(), _retclen(), ISCURRENCY(), CURR_STOY(), CURR_YTOS()