AngularJS currency filter: can I remove the .00 if there are no cents in the amount?

后端 未结 3 860
闹比i
闹比i 2021-02-20 09:32

I am following this: http://docs.angularjs.org/api/ng.filter:currency When I type 1234.56 in the field then the output should be $1,234.56. But if I type in the input 1234 then

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-02-20 10:06

    I prefer this answer as it keeps the commas to separate thousands:

    Removing AngularJS currency filter decimal/cents

提交回复
热议问题