3
votes

I want to format using currency filter in AngularJS like the following:

Rp 2.000,00

(using dot as thousand separator, and comma as decimal separator) Currently I am using:

{{product.originalPrice | currency:"Rp "}}

The result:

Rp 2,000.00

Which is not common in our country. How to do it? Thank you.

2

2 Answers

2
votes

Angular has full support of i18n and l10n.

To do what you want you have to include angular-locale_id-id.js and then format will be just as you need.

For your locale angular's number format is:

"NUMBER_FORMATS": {
  "CURRENCY_SYM": "Rp",
  "DECIMAL_SEP": ",",
  "GROUP_SEP": "."
  ...
}
0
votes

try this

value | currency:'IDR ':'symbol':'3.0'

or

value | currency:'Rp':'symbol':'3.0'

https://www.angularjswiki.com/angular/angular-currency-pipe-formatting-currency-in-angular/