Shawn,

Any time you divide an integer number of cents you may end up with a
fraction of a cent. I would use the INT() function like this:

    X.EMPLYR.AMT = INT(MO.PREM * 0.8)
and
    X.EMPLYE.AMT = INT(X.EMPLYR.AMT / 2) 
    X.EMPLYR.AMT = X.EMPLYR.AMT - X.EMPLYE.AMT

I hope that helps!

Derek Falkner
Kingston, Ontario, Canada


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Shawn Waldie
Sent: Tuesday, November 30, 2004 2:24 PM
To: [EMAIL PROTECTED]
Subject: [U2] [UD] Precision

I need some help from you payroll pros out here.

<snip>

-Based on the employees' salary, the employer will pay either 80, 70, or 60
percent of this premium; with the employee  paying the difference. -The
Paychecks are issued semi-monthly.

Here's my logic so far:

MO.PREM = PREM.TBL<X,Y>

BEGIN CASE
  CASE X.SALARY LT 30000                             ; * Employer pays 80%
    X.EMPLYR.AMT = MO.PREM * 8 / 10
    X.EMPLYE.AMT = MO.PREM - X.EMPLYR.AMT
  CASE ((X.SALARY GE 30000) AND (X.SALARY LT 40000)) ; * Employer pays 70%
    X.EMPLYR.AMT = MO.PREM * 7 / 10
    X.EMPLYE.AMT = MO.PREM - X.EMPLYR.AMT
  CASE X.SALARY GE 40000                             ; * Employer pays 60%
    X.EMPLYR.AMT = MO.PREM * 6 / 10
    X.EMPLYE.AMT = MO.PREM - X.EMPLYR.AMT
  CASE 1
END CASE

* Divide these amounts by two since since employees are payed twice per
month. 
X.EMPLYR.AMT = X.EMPLYR.AMT / 2 
X.EMPLYE.AMT = X.EMPLYE.AMT / 2

<snip>

Suggestions welcome!
************************************************
* Shawn Waldie                San Juan College *
* Programmer/Analyst         4601 College Blvd *
* Phone: (505)566-3072   Farmington, NM  87402 *
*      email: [EMAIL PROTECTED]       *
************************************************
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to