_RetCurrency( ) API Library Routine

JavaScript Editor js editor     Web development 



Main Page

Sets the library return value to a currency value.

void _RetCurrency(CCY money, int width)
CCY money;         /* CCY - LARGE_INTEGER. */
int width;         /* Number of columns to display. */

Remarks

For more information on how to create an API library and integrate it with Visual FoxPro, see Accessing the Visual FoxPro API.

Example

The following example converts a numeric type value to currency type value.

Visual FoxPro Code

В Copy Code
SET LIBRARY TO RETCURR
? xntom(100.1)

C Code

В Copy Code
#include <pro_ext.h>
#include <math.h>

void FAR retcurr(ParamBlk FAR *parm)
{
   CCY money;

   money.HighPart = (long) (parm->p[0].val.ev_real*10000 / pow(2,32));
   
   money.LowPart = (unsigned long) ((parm->p[0].val.ev_real - (double) (money.HighPart * pow(2,32)/10000.0)) *10000);
   
   _RetCurrency(money,25);
}

FoxInfo myFoxInfo[] = {
   {"XNTOM", (FPFI) retcurr, 1, "N"}
};
FoxTable _FoxTable = {
   (FoxTable FAR *) 0, sizeof(myFoxInfo)/sizeof(FoxInfo), myFoxInfo
};

See Also



JavaScript Editor js editor     Web development