# Have I Finally Become Dense? (Rounding Issue)

• 01-09-2013, 10:39 PM
rswyatt
Have I Finally Become Dense? (Rounding Issue)
I've been at PHP for more years than I care to say... And now I think I've become dense or maybe I should quit my job and become a sanitation driver. :-)

Client has a total * tax rate = something like .6201... Their POS system (not PHP) rounds .6201 up to .63 - which makes zero sense to me...

How in the world would I force my round function to insist that 0 in the thousands place is high enough to round up to 3. This defies mathematics and I'm stumped.

Thanks!
• 01-09-2013, 10:59 PM
TFlan
You say this is a PoS (I'm assuming you mean Point of Sale and not Piece of S**t).

A previous job of mine was a manager at a new start-up resturant. I worked closely with the PoS guys, so if something went wrong I could fix it on the spot.

Through this, I became very familiar with PoS's.

If there is any thousandth's decimal, most, if not all, PoS's will always round up - why? Money. Those fractions of a penny add up after a full day of sales. So if it didn't round up, the business could potential take a big hit, think 200 orders a day, each with .004 cents cut from that is .80 cents. .80 cents a day is \$292 dollars a year - and that's thinking very conservatively.

For example, have you ever seen Office Space? It is the same principal.

===

Now as for your question, I'm not completely sure what you are asking...
• 01-09-2013, 11:19 PM
tracknut
You would add 0.005 before rounding. .6201+.005 = .6351, which rounds up to .63

Dave
• 01-10-2013, 02:06 PM
hinch
ceil()

always round up!