View Single Post
Old 12-02-2004, 04:58 PM   #2 (permalink)
Rawb
Crazy
 
Location: Salt Town, UT
My inital suggestion would be to calculate everything in minutes. Then you are always dealing with whole numbers, so you never calculate a total of 3.955555555555 for someone's bill. I have built large-scale billing systems for a few companies, and the first thing you learn is that you never calculate anything as a float that you can calculate as an int.

Next off, you cannot use modulo division (the %) on a float because there is no remainder when dividing floats. They are floating point numbers, so 7.0/3.0 = 2.333333, not 2 remainder 1.

Let me know if you need some more help, other than my random points of style.
Rawb is offline  
 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62