<p>I could be wrong here as I've not used subscriptions with Commerce yet, but using the filter <code>|currency</code> worked perfectly for me when outputting the correct format after having tried <code>|replace</code> and <code>|number</code>.</p>

CC BY-SA 4.0
2018-10-08T14:22:46.633Z
I thought that might have worked, but sadly it still just output `£30,000.00` :(
Jason Mayo
CC BY-SA 4.0
2018-10-08T11:17:50.517Z
2018-10-08T11:17:50.517Z
fbnntt
<p>Stripe <a href="https://stripe.com/docs/api#balance_transaction_object-amount" rel="nofollow noreferrer">stores the amount in cents</a>. If you want to format it from the <code>subscriptionPlanData.plan.amount</code> variable in your template you would need to divide by 100 first.</p>

<pre><code>{{ (subscriptionPlanData.plan.amount / 100)|currency }}
</code></pre>

CC BY-SA 4.0
2018-10-12T00:18:46.630Z
2018-10-12T00:18:46.630Z
Stephen Bowling
<p>We've currently got Subscriptions setup on a site which works a charm, but my main issue is outputting the price of the subscription, after the user has subscribed.</p>

<p>From the docs/templates I can even see how this is possible?! </p>

<p>You can get it via:</p>

<pre><code>{% set subscriptions = craft.subscriptions.user(currentUser) %}

{% for subscription in subscriptions %}
    {{ subscriptionPlanData.plan.amount }}
{% endfor %}
</code></pre>

<p>But if for example, the plan is <code>£300.00</code> then it outputs as <code>30000</code> and when formatted, it comes out like <code>30,000.00</code> using <code>{{ subscriptionPlanData.plan.amount|number_format(2, '.', ',') }}</code></p>

<p>I can't see anyway of showing the user, how much they've paid in a human format without hacking around the number.</p>

<plugin-craftcommerce><plugin-craftcommerce2>
Commerce 2 Subscription Prices
# Commerce 2 Subscription Prices

(Asked by: username_0 on 2018-10-08)

We've currently got Subscriptions setup on a site which works a charm, but my main issue is outputting the price of the subscription, after the user has subscribed.
From the docs/templates I can even see how this is possible?! 
You can get it via:
{% set subscriptions = craft.subscriptions.user(currentUser) %}

{% for subscription in subscriptions %}
    {{ subscriptionPlanData.plan.amount }}
{% endfor %}

But if for example, the plan is £300.00 then it outputs as 30000 and when formatted, it comes out like 30,000.00 using {{ subscriptionPlanData.plan.amount|number_format(2, '.', ',') }}
I can't see anyway of showing the user, how much they've paid in a human format without hacking around the number.

**Tags:** plugin-craftcommerce, plugin-craftcommerce2

---

## 2 answers

### Answer by username_2 on 2018-10-12. Score: 4 | Accepted answer

Stripe stores the amount in cents. If you want to format it from the subscriptionPlanData.plan.amount variable in your template you would need to divide by 100 first.
{{ (subscriptionPlanData.plan.amount / 100)|currency }}


---

### Answer by username_1 on 2018-10-08. Score: 2

I could be wrong here as I've not used subscriptions with Commerce yet, but using the filter `|currency` worked perfectly for me when outputting the correct format after having tried `|replace` and `|number`.

> **Comments:**
> **username_0**: I thought that might have worked, but sadly it still just output `£30,000.00` :(  

---

