Dear Rbase buddies,

 

I have written a payroll program that finally works almost perfectly.  I say almost because…..

 

Say the employee makes $11 per hour, and they get time and a half for overtime, and they have 0.83 hours of overtime.  How much overtime pay should they get?  Using REAL numbers (instead of currency) as follows…

(11 * .83  * 1.5) = 13.695, which should round up to $13.70.

 

Using Currency, and variables as follows…..

SET V v1 CURRENCY = 11

SET V v2 REAL = .83

SET V v3 CURRENCY

SET V v3 = (.v1 * .v2 * 1.5)   produces $13.69. 

 

Shouldn’t that round up to $13.70? 

 

I could rewrite the software using all real numbers, and convert at the end, but shouldn’t I get the same result?

 

Mike Sinclair

Reply via email to