admin管理员组文章数量:1335877
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.
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.
Share Improve this question asked Nov 21, 2016 at 7:45 techVtechV 9353 gold badges23 silver badges41 bronze badges 1- pls refer this link fiddle.jshell/creekworm/M83uK – Murali Commented Nov 21, 2016 at 7:52
3 Answers
Reset to default 5You 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
Try this
Html
{{amount | currency:"₹":0}}
please refer https://docs.angularjs/api/ng/filter/currency
Add this format in html {{amount | currency:"₹":0}} you can also see it on url below. https://docs.angularjs/api/ng/filter/currency
本文标签: javascriptangular currency filters in indian formatStack Overflow
版权声明:本文标题:javascript - angular currency filters in indian format - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742397100a2467149.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论