<p>What does <code>cart.currency</code> return?</p>

<p>The Twig <code>currency</code> filter ultimately uses Yii's <a href="http://yiiframework.com/doc/api/1.1/CNumberFormatter#format-detail" rel="nofollow"><code>CNumberFormatter</code></a> class. This uses the symbol you are seeing as a default placeholder for the currency symbol if one cannot be determined from the value of the <code>$currency</code> parameter passed to it. This would indicate that the value of <code>cart.currency</code> is not as expected. You'll need to make sure that the <code>cart</code> variable is being set correctly in your template, then this should work.</p>

CC BY-SA 3.0
2016-08-09T10:44:54.803Z
2016-08-09T10:44:54.803Z
Steve Rowling
<p>As <a href="https://craftcms.stackexchange.com/questions/16267/craft-commerce-not-outputting-%E2%82%AC-symbol#comment22613_16267">Steve mentions</a>, most likely this is because the font you are using on the front-end of your site doesn't know how to display the € symbol.</p>

<p>I just tested on a fresh Craft/Commerce install on OSX/Chrome and the default Commerce templates display € as expected.</p>

CC BY-SA 3.0
2016-08-09T09:40:20.577Z
See reply to Steve above.
Clive Portman
CC BY-SA 3.0
2016-08-09T17:46:18.087Z
Once again, I bow to @SteveRowling's superior knowledge.
Brad Bell
CC BY-SA 3.0
2016-08-09T03:07:09.567Z
2016-08-09T03:07:09.567Z
Brad Bell
<p>Within Settings, the cart currency is set to Euros. But when I use:</p>

<pre><code>{{ product.defaultVariant.price | currency(cart.currency) }}
</code></pre>

<p>The output is:</p>

<pre><code>¤150.49
</code></pre>

<p>Anyone encountered this before?</p>

CC BY-SA 3.0
2016-08-08T18:08:21.430Z
Is this perhaps related to the font you are using to show the currency in front-end templates? Have you tried using different fonts to see if the problem persists?
Steve Rowling
CC BY-SA 3.0
2016-08-09T09:40:08.997Z
No, I don't think so. I'm just using Arial and it's in the page source.
Clive Portman
CC BY-SA 3.0
2016-08-09T10:07:51.340Z
What does `cart.currency` return? Looking through the code, the Twig `currency` filter ultimately uses Yii's `CNumberFormatter` class. This uses the symbol you are seeing as a default placeholder for the currency symbol if one cannot be determined from the value of the `$currency` parameter passed to it. See here: http://www.yiiframework.com/doc/api/1.1/CNumberFormatter#format-detail This would indicate that the value of `cart.currency` is not as expected. How is this being set?
Steve Rowling
CC BY-SA 3.0
2016-08-09T10:41:21.093Z
Good point. That was the problem. I'd not included {% set cart = craft.commerce.cart %} anywhere so the cart was missing. Do you want to add that as an answer and I'll mark it as accepted?
Clive Portman
CC BY-SA 3.0
2016-08-09T10:46:10.023Z
Great! I've added is as an answer now.
Steve Rowling
<plugin-craftcommerce>
Craft Commerce not outputting € symbol
# Craft Commerce not outputting € symbol

(Asked by: username_0 on 2016-08-08)

Within Settings, the cart currency is set to Euros. But when I use:
{{ product.defaultVariant.price | currency(cart.currency) }}

The output is:
¤150.49

Anyone encountered this before?

**Tags:** plugin-craftcommerce
> **Comments:**
> **username_1**: Is this perhaps related to the font you are using to show the currency in front-end templates? Have you tried using different fonts to see if the problem persists?  
> **username_0**: No, I don't think so. I'm just using Arial and it's in the page source.  
> **username_1**: What does `cart.currency` return? Looking through the code, the Twig `currency` filter ultimately uses Yii's `CNumberFormatter` class. This uses the symbol you are seeing as a default placeholder for the currency symbol if one cannot be determined from the value of the `$currency` parameter passed to it. See here: http://www.yiiframework.com/doc/api/1.1/CNumberFormatter#format-detail This would indicate that the value of `cart.currency` is not as expected. How is this being set?  
> **username_0**: Good point. That was the problem. I'd not included {% set cart = craft.commerce.cart %} anywhere so the cart was missing. Do you want to add that as an answer and I'll mark it as accepted?  
> **username_1**: Great! I've added is as an answer now.  

---

## 2 answers

### Answer by username_1 on 2016-08-09. Score: 2 | Accepted answer

What does `cart.currency` return?

The Twig `currency` filter ultimately uses Yii's [`CNumberFormatter`](http://yiiframework.com/doc/api/1.1/CNumberFormatter#format-detail) class. This uses the symbol you are seeing as a default placeholder for the currency symbol if one cannot be determined from the value of the `$currency` parameter passed to it. This would indicate that the value of `cart.currency` is not as expected. You'll need to make sure that the `cart` variable is being set correctly in your template, then this should work.


---

### Answer by username_2 on 2016-08-09. Score: 0

As [Steve mentions](https://craftcms.stackexchange.com/questions/16267/craft-commerce-not-outputting-%E2%82%AC-symbol#comment22613_16267), most likely this is because the font you are using on the front-end of your site doesn't know how to display the € symbol.

I just tested on a fresh Craft/Commerce install on OSX/Chrome and the default Commerce templates display € as expected.

> **Comments:**
> **username_0**: See reply to Steve above.  
> **username_2**: Once again, I bow to @SteveRowling's superior knowledge.  

---

