Re: Adding the pennies correctly

From: <rtproffitt_at_my-deja.com>
Date: Tue, 29 Jun 1999 23:11:51 GMT
Message-ID: <7lbjre$udq$1_at_nnrp1.deja.com>


But if you must use the client for math, then take precautions, such as using long integer for addition, truncating and rounding all division results before any addition... etc.

I had a similar problem once reading into Pascal from dBase. The only way to get the correct result was to write some routines to do the things I mentioned above...

such as, x = round ( n / m * 100) / 100

           (round to two decimal places)

Robert Proffitt

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't. Received on Wed Jun 30 1999 - 01:11:51 CEST

Original text of this message