Hello and welcome to our community! Is this your first visit?
AdSlot7
Enjoy an ad free experience by logging in. Not a member yet? Register.

# Thread: Have I Finally Become Dense? (Rounding Issue)

1. ## 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!

2. AdSlot6
3. 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...

4. You would add 0.005 before rounding. .6201+.005 = .6351, which rounds up to .63

Dave

5. ceil()

always round up!

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•
AdSlot4
AdSlot5