Angular 4 - How to use currency pipe in input type

后端 未结 2 2050
庸人自扰
庸人自扰 2021-02-06 01:43

I have an HTML input:


I want to format its value and use an existi

2条回答
  •  清酒与你
    2021-02-06 01:59

    I think this is a solution for you:

    
    

    And then in your controller. Currency mark in from value in input:

      currencyInputChanged(value) {
        var num = value.replace(/[$,]/g, "");
        return Number(num);
      }
    

提交回复
热议问题