Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Indonesian Currency on Angular

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.

like image 800
Ardianto Satriawan Avatar asked Sep 02 '25 17:09

Ardianto Satriawan


1 Answers

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": "."
  ...
}
like image 160
xZ6a33YaYEfmv Avatar answered Sep 05 '25 16:09

xZ6a33YaYEfmv