# Auto rounding does not work properly

Dear expertise… I have implemented auto round feature in sambapos 4 but it seems doesn’t work properly. When I open a new ticket .5 is always there on new ticket. Also it always do auto round up not down at all… and one more thing if both the previous question solved . I want to round .50 cents. Suppose the customer bill is let’s say between \$5.01 to 5.49 it should decrease to only \$5. But if the bill is between \$5.50 to \$5.99 then it should increase to \$6. No more cents only dollar. How can I do that please

Have you specified rounding up?
Pretty sure the default round given number of places follows the normal mathematical method of .5 up and .49 down…

Did you see this?

Yes I saw and hen I applied the first method auto round. If I set the amount nearest 50 cents then it auto round the amount of exact amount for example. If the bill is \$5 it is makinf \$5.50 . It’s making every bill with 50 cents extra. I want it increase the value if it’s is more than 50 cents to next dollar like 6 dollar 7 dollar 8 dollar. Or if the amount is less than 50 cents it decrease the amount to again exact dollar. And if the amount is exact dollar like 5,6,7 or else amount it should remain the same no increase or no decrease thanks emre

Did you set Calculation Method as “Round Ticket Total” for both Calculation Types?

Yes … I did . I followed the each and every step that you showed in your tutorials thanks

Can you show us some screenshots of your Calculation Types?

PS: @Navdeep_Singh If you want it to round to nearest dollar then the amount for both calculations should be 1.0 not 0.5[quote=“Navdeep_Singh, post:6, topic:13630, full:true”]
Yes … I did . I followed the each and every step that you showed in your tutorials thanks
[/quote]

That might be your problem his tutorial shows rounding to nearest .50 not nearest 1.0 try that change see what happens.

1 Like

It still not working properly after putting 1.0 in max amount @Jesse see in the attachment… the amount in the should be 23. After rounding 0.10 cents … but it is doing something else see in the attachment… it should round exactly amount

It still not working properly after putting 1.0 in max amount @ kendash @ emre … see in above attachment… the amount in the should be 23. After rounding 0.10 cents … but it is doing something else see in the attachment… it should round exactly amount

Show us your calculation type. You probably need to enable Tax Included option.

@Jesse I did tax included option . And follow everything in tutorial

Show a screenshot of your settings if you can.

Its mot rounding by 10 cents you have it setup to round by 1%. I dont use rounding so not sure how it should look on the screen but i think youve definitely set it up wrong as what appears on the ticket is correct

Ticket total = 20.00
Tax = 2.90

Total = 22.90

1% of 22.90 is 0.23

Add 22.90 and 0.23 you get 23.13

Youll need to show how you calulation is setup

2 Likes

You have wrong calculation type, sure you set fixed amount, you have 1 and discounting 1% so think you’ve selected %/rate rather than amount

1 Like

I have also a issue with rounding
I need flat template for rounding. for example my amount is 5.01 or 5.66 or any 5.++ it should be auto round in 6

Dont think it works like like that, pretty sure it uses standard rounding eg 0-0.49 is rounded down and 0.51-0.99 is rounded up.

So you wont get 5.01 rounded up to 6 as that just isnt mathematically correct

You will probably have to automate the round rather than use the rate/amount in the calculation selector.
Using a ticket total changed event update the round calculation amount (fixed amount calculation) using some math code.
Round ceiling or something like that.

`[=F( Math.ceil(TN('TICKET TOTAL}') - TN('{TICKET TOTAL}') ) ]`

1 Like

@QMcKay… divide? if its setting a fixed amount round would it not be minus?
Ticket Total rounded up minus ticket total = fixed amount to round up by (fixed amount charge added)?

You are correct @JTRTech. I read the bracketing wrong - it looked like to me at first glance you were taking Total minus Total then doing `ceil`, which would always give `0` LOL. I changed it back to your original.

1 Like