ratkov_a
ratkov_a

Reputation: 53

Write custom currency filter that will do converting based on locale in Angularjs

I have some value that represent price. I want when i change locale in my navbar to convert that price. So i was wondering is it possible to do that with custom filter?

Upvotes: 0

Views: 227

Answers (1)

BuriB
BuriB

Reputation: 1343

It's possible, yes. But instead of converting the price to an other currency on the frontend, you should get the price information from the backend in the currency you're requesting it, since it's a data and you shouldn't mess around with it on the frontend, especially because it's money.

Upvotes: 1

Related Questions