Dev Overflow Dev Overflow - 1 month ago 47
Javascript Question

Filter currency not working after upgrade

I've just upgraded to vue.js version 2. However after upgrading to vue.js version 2 my currency filter isn't working anymore. it throws a error on console.

<span class="amount">{{ amount | currency '£' }</span>


Console erro


Failed to resolve filter: currency '£'

Answer

Built in Text filters has been removed in vue.js version-2.

Replacing the currency Filter

'£' + price.toFixed(2)

Reference

https://vuejs.org/v2/guide/migration.html#Replacing-the-currency-Filter