<p>The rounding you are talking about is for cash. The rounding is to nearest 5c because it is likely the smallest denomination in circulation.</p>

<p>Online, with electronic transactions, the base will always be whole cents (or localised equivalent.) Credit Card and electronic purchases can always transaction in these minor units.</p>

<p>Craft Commerce doesn't have the ability to round to cash-based values (likely to be used in POS), but you are welcome to make a feature request here: <a href="http://feedback.craftcms.com/" rel="nofollow noreferrer">http://feedback.craftcms.com/</a></p>

CC BY-SA 3.0
2018-01-24T08:53:22.593Z
Hi @luke, thanks for your answer. Yeah that's true, but my shops will not operate with credit card payments (manual gateway aka invoices only). I have two shops in the pipeline and this rounding issue is absolutely crucial. Is there any way (through a plugin maybe) to achive the desired behaviour?
marsask
CC BY-SA 3.0
2018-01-24T01:18:26.233Z
2018-01-24T01:18:26.233Z
Luke Holder
<p>Is there a way to change the default rounding behaviour of Craft Commerce? Here in Switzerland we always round to 5 cents, so amounts like 9.99 or 9.22 don't really exist. Here's an example:</p>

<ul>
<li>9.99 must be rounded to 10.00</li>
<li>9.98 must be rounded to 10.00</li>
<li>9.97 must be rounded to 9.95</li>
<li>9.96 must be rounded to 9.95</li>
<li>9.95 must stay the same</li>
<li>9.94 must be rounded to 9.95</li>
<li>9.93 must be rounded to 9.95</li>
<li>9.92 must be rounded to 9.90</li>
<li>9.91 must be rounded to 9.90</li>
</ul>

<p><strong>Product Prices</strong><br>
The product prices we enter manually do follow the guidelines mentioned above, so we never get "odd" prices when putting products to the cart.</p>

<p><strong>Shipping Costs</strong><br>
Shipping costs are also no problem (it's either free or fixed price shipping).</p>

<p><strong>Taxes</strong><br>
Taxes are a problem for us since we use a tax rate of 7.7% which can lead to "odd" tax amounts (and this leads to "odd" total amounts).</p>

<p><strong>Discounts</strong><br>
Discounts can also be a problem since they also sometimes lead to "odd" numbers (i.e. a 10% coupon on 14.85 is giving a discount result of -1.49 instead of -1.50).</p>

<p>So is there any way to change the rounding behaviour (either globally or for taxes only)? On the frontend part I think we could achieve that with the Twig filter "number_format", but we need the correct amounts also in the backend.</p>

<plugin-craftcommerce><rounding>
Craft Commerce: Custom Rounding (for taxes and discounts)
# Craft Commerce: Custom Rounding (for taxes and discounts)

(Asked by: username_0 on 2018-01-22)

Is there a way to change the default rounding behaviour of Craft Commerce? Here in Switzerland we always round to 5 cents, so amounts like 9.99 or 9.22 don't really exist. Here's an example:

* 9.99 must be rounded to 10.00
* 9.98 must be rounded to 10.00
* 9.97 must be rounded to 9.95
* 9.96 must be rounded to 9.95
* 9.95 must stay the same
* 9.94 must be rounded to 9.95
* 9.93 must be rounded to 9.95
* 9.92 must be rounded to 9.90
* 9.91 must be rounded to 9.90

**Product Prices**  
The product prices we enter manually do follow the guidelines mentioned above, so we never get "odd" prices when putting products to the cart.

**Shipping Costs**  
Shipping costs are also no problem (it's either free or fixed price shipping).

**Taxes**  
Taxes are a problem for us since we use a tax rate of 7.7% which can lead to "odd" tax amounts (and this leads to "odd" total amounts).

**Discounts**  
Discounts can also be a problem since they also sometimes lead to "odd" numbers (i.e. a 10% coupon on 14.85 is giving a discount result of -1.49 instead of -1.50).

So is there any way to change the rounding behaviour (either globally or for taxes only)? On the frontend part I think we could achieve that with the Twig filter "number\_format", but we need the correct amounts also in the backend.

**Tags:** plugin-craftcommerce, rounding

---

## 1 answers

### Answer by username_1 on 2018-01-24. Score: 1

The rounding you are talking about is for cash. The rounding is to nearest 5c because it is likely the smallest denomination in circulation.

Online, with electronic transactions, the base will always be whole cents (or localised equivalent.) Credit Card and electronic purchases can always transaction in these minor units.

Craft Commerce doesn't have the ability to round to cash-based values (likely to be used in POS), but you are welcome to make a feature request here: <http://feedback.craftcms.com/>

> **Comments:**
> **username_0**: Hi @luke, thanks for your answer. Yeah that's true, but my shops will not operate with credit card payments (manual gateway aka invoices only). I have two shops in the pipeline and this rounding issue is absolutely crucial. Is there any way (through a plugin maybe) to achive the desired behaviour?  

---

