Jason

You are, of course, correct - I don't know why I missed the first one because I specifically tested for it - I shall try to heed this warning and think a little harder in future

cheers

Tom

On 2 Apr 2007, at 20:05, Jason L. DeLooze wrote:

Hi Tom,

There's problems with your implementation. Consider the follow inputs into your function: 23.04 and 18.996.

===
For 23.04,

dollars = Int(23.04) = 23
cents = Round(23.04 - 23 ; 2) = Round(0.04;2) = 0.04
CentsAsText = Left(100 * 0.04 & "00";2) = Left(4 & "00";2) = Left ("400";2) = "40", which is incorrect.
===

The above result happens for amounts with cent values between 0.01 and 0.09.

===

You can carefully work through "18.996" to see the problems there. However, "18.996" may be ouotside the domain of Sue's input.

Regards,
Jason L. DeLooze
Annapolis, MD  USA

Reply via email to