/* DEC	*DividePercent(pDst,pSrc1,pSrc2)
 *
 * ARGUMENT
 *	DEC	*pDst, *pSrc1, pSrc2;
 *
 * DESCRIPTION
 *	Divides	pSrc1 by pSrc2 percent,	stroring the result in pDst.
 *	pDst = pSrc1 / (pSrc2/100)
 *	pDst is	rounded	two 2 decimal places.
 *
 * SIDE	EFFECTS
 *	None.
 *
 * RETURNS
 *	Returns	a pointer to the dest structure	unless an error	occurs,
 *   when it returns a GM_NULL.
 *
 *
 * POSSIBLE ERROR CODES
 *
 *	GM_NULLPOINTER
 *	GM_OVERFLOW
 *	GM_UNDERFLOW
 *	GM_DIV0
 *
 * AUTHOR
 *  Jared Levy
 *   Copyright (C) 1987-1990 Greenleaf Software	Inc.  All rights reserved.
 *
 * MODIFICATIONS
 *
 */

#include <stdio.h>
#include "gm.h"
#include "gmsystem.h"

DEC	*DividePercent(pDst,pSrc1,pSrc2)
DEC	*pDst;
DEC	*pSrc1,*pSrc2;
{
	DEC	dtemp, *temp=&dtemp;

	_MacStart(GM_PDIV);

	_MacDCopy(temp,	pSrc2);
	temp->dc.id += 2;

	pDst = DivideDecimalAndRound(pDst, pSrc1, temp,	2);
	_MacRet(pDst);
	/* error flag set by DivideDecimalAndRound */
}