<p>This is how I solved it in a Craft project:</p>
<pre><code>{% set moneyHelper = create('craft\\helpers\\MoneyHelper') %}
{{ moneyHelper.toDecimal(entry.price) }}
</code></pre>
<p>See <a href="https://docs.craftcms.com/api/v5/craft-helpers-moneyhelper.html" rel="nofollow noreferrer">MoneyHelper</a> docs</p>

CC BY-SA 4.0
2024-09-23T21:57:51.990Z
Hi Jesse, thanks for your answer. I tried adding the exact code above into a template as my field is also named entry.price, but nothing was outputted at all. Any ideas?
Stephen
CC BY-SA 4.0
2024-09-24T14:39:57.887Z
I just tried it out and seems to work fine. Maybe a CMS version issue (i'm on Craft 5.4.2). Other than that, maybe worth debugging the `MoneyHelper::toDecimal` function from the vendor/ directory? Or reach out on the Craft discord why it would output blank?
Jesse
CC BY-SA 4.0
2024-09-23T07:51:44.450Z
2024-09-23T07:51:44.450Z
Jesse
<p>How can I output the value from a Money field in Craft 4, without outputting the currency symbol, as easily as possible?</p>
<p>Using: <code>{{ entry.price }}</code> Outputs: <code>Error: Object of class Money\Money could not be converted to string.</code></p>
<p>I then tried using <code>{{ entry.price|money }}</code>, but that outputs the currency symbol too, e.g. <code>£20.00</code></p>
<p>This is what I want to output, but I can't figure out how to do it:</p>
<blockquote>
<p>20.00</p>
</blockquote>
<p>The <a href="https://craftcms.com/docs/4.x/money-fields.html" rel="nofollow noreferrer">Craft CMS Money Field docs page</a> isn't much help to me (as a non-dev) as it lacks example code snippets that I can easily see and use.</p>
<p>Thanks in advance for any help.</p>
<p>Stephen</p>

<templating>
How to output value from Money field in Craft 4, without outputting the currency symbol
# How to output value from Money field in Craft 4, without outputting the currency symbol

(Asked by: username_0 on 2024-09-22)

How can I output the value from a Money field in Craft 4, without outputting the currency symbol, as easily as possible?

Using: `{{ entry.price }}` Outputs: `Error: Object of class Money\Money could not be converted to string.`

I then tried using `{{ entry.price|money }}`, but that outputs the currency symbol too, e.g. `£20.00`

This is what I want to output, but I can't figure out how to do it:

> 20.00

The [Craft CMS Money Field docs page](https://craftcms.com/docs/4.x/money-fields.html) isn't much help to me (as a non-dev) as it lacks example code snippets that I can easily see and use.

Thanks in advance for any help.

username_0

**Tags:** templating


---

## 1 answers

### Answer by username_1 on 2024-09-23. Score: 2

This is how I solved it in a Craft project:
{% set moneyHelper = create('craft\\helpers\\MoneyHelper') %}
{{ moneyHelper.toDecimal(entry.price) }}

See MoneyHelper docs

> **Comments:**
> **username_0**: Hi username_1, thanks for your answer. I tried adding the exact code above into a template as my field is also named entry.price, but nothing was outputted at all. Any ideas?  
> **username_1**: I just tried it out and seems to work fine. Maybe a CMS version issue (i'm on Craft 5.4.2). Other than that, maybe worth debugging the `MoneyHelper::toDecimal` function from the vendor/ directory? Or reach out on the Craft discord why it would output blank?  

---

