Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

angular currency filters in indian format

I am working on angular based application, its a financial application. In which, I need to display numbers in currency format in dynamic html. Below is the way I have used for this requirement :

$filter('currency')(amount)

it is working fine but it is showing number in US format but I need to display number in indian format.

Example : var amount = 100000

If I am going with above way then number is displayed as 100,000.

Desired Output: 1,00,000

Any help will be appreciated.

like image 217
techV Avatar asked Dec 05 '25 19:12

techV


2 Answers

You can use Number.Prototype.toLocaleString() and as your indian you can use it directly,but if you have to specify format ,specify it as Number("100000").toLocaleString('en-IN')

check the following snippet

console.log(Number("100000").toLocaleString('en-IN'));

Hope it helps

like image 98
Geeky Avatar answered Dec 08 '25 08:12

Geeky


Try this

Html

{{amount | currency:"₹":0}}

please refer https://docs.angularjs.org/api/ng/filter/currency

like image 42
Murali Avatar answered Dec 08 '25 08:12

Murali



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!