<p>The current formatter looks at the currency's format and the current locale of the user. What locale are you set to?</p>

<p>You can drop the zeros with the stripZeros param in the currencyConvert filter. See docs here: <a href="https://craftcommerce.com/docs/twig-filters" rel="nofollow noreferrer">https://craftcommerce.com/docs/twig-filters</a></p>

CC BY-SA 3.0
2016-11-14T11:05:46.057Z
The locale was set to English, whereas this will be a French website. So the currency format is now correct, thank you!

But unfortunately this still doesn't work for dropping the zeros : `{{ product.variants[0].salePrice | commerceCurrency(cart.currency, stripZeros = true) }}`. Do you have any idea of what's going wrong, or should I contact the Craft Commerce support for this?
Romain P.
CC BY-SA 3.0
2016-11-15T09:36:44.383Z
The twig filter params are positional like php function params. If you want to strip zeros you need that param in the fourth position.
Luke Holder
CC BY-SA 3.0
2016-11-16T09:06:34.223Z
Thank you, but I forgot to mention that I tried all of these possibilities, and none works for me to drop the zeros.

`{{ product.variants[0].salePrice | commerceCurrency(cart.currency, stripZeros = true) }}`,
`{{ product.variants[0].salePrice | commerceCurrency(cart.currency, convert=true, format=true, stripZeros=true) }}`,
`{{ product.variants[0].salePrice | commerceCurrency('EUR', convert=true, format=true, stripZeros=true) }}`.
Romain P.
CC BY-SA 3.0
2016-11-17T08:47:21.750Z
I finally contacted the Craft support and Brad told me that they recently fixed a bug (again) around this. He sent me a new NumberFormatter.php file (located in craft/app/etc/i18n) which fix this issue and that should be included in the next plugin update.
Romain P.
CC BY-SA 3.0
2016-11-10T22:13:37.223Z
2016-11-10T22:13:37.223Z
Luke Holder
<p>Using commerceCurrency filter from the Craft commerce plugin, how can I add the currency name after the price instead of before the price, and drop the zeros when not necessary ?</p>

<p>For example :</p>

<pre><code>{{ product.variants[0].salePrice | commerceCurrency(cart.currency) }}
</code></pre>

<blockquote>
  <p>€68.00</p>
</blockquote>

<p>How can I output this :</p>

<blockquote>
  <p>68€</p>
</blockquote>

<p>Thank you!</p>

<templating><plugin-craftcommerce><filter>
How to set the commerceCurrency filter in an European style
# How to set the commerceCurrency filter in an European style

(Asked by: username_0 on 2016-11-10)

Using commerceCurrency filter from the Craft commerce plugin, how can I add the currency name after the price instead of before the price, and drop the zeros when not necessary ?
For example :
{{ product.variants[0].salePrice | commerceCurrency(cart.currency) }}


€68.00

How can I output this :

68€

Thank you!

**Tags:** templating, plugin-craftcommerce, filter

---

## 1 answers

### Answer by username_1 on 2016-11-10. Score: 1 | Accepted answer

The current formatter looks at the currency's format and the current locale of the user. What locale are you set to?

You can drop the zeros with the stripZeros param in the currencyConvert filter. See docs here: <https://craftcommerce.com/docs/twig-filters>

> **Comments:**
> **username_0**: The locale was set to English, whereas this will be a French website. So the currency format is now correct, thank you!  But unfortunately this still doesn't work for dropping the zeros : `{{ product.variants[0].salePrice | commerceCurrency(cart.currency, stripZeros = true) }}`. Do you have any idea of what's going wrong, or should I contact the Craft Commerce support for this?  
> **username_1**: The twig filter params are positional like php function params. If you want to strip zeros you need that param in the fourth position.  
> **username_0**: Thank you, but I forgot to mention that I tried all of these possibilities, and none works for me to drop the zeros.  `{{ product.variants[0].salePrice | commerceCurrency(cart.currency, stripZeros = true) }}`, `{{ product.variants[0].salePrice | commerceCurrency(cart.currency, convert=true, format=true, stripZeros=true) }}`, `{{ product.variants[0].salePrice | commerceCurrency('EUR', convert=true, format=true, stripZeros=true) }}`.  
> **username_0**: I finally contacted the Craft support and Brad told me that they recently fixed a bug (again) around this. He sent me a new NumberFormatter.php file (located in craft/app/etc/i18n) which fix this issue and that should be included in the next plugin update.  

---

