AngularJS how to force an input to be re-rendered on blur

前端 未结 5 1634
攒了一身酷
攒了一身酷 2020-12-24 14:17

I have some custom validation code, which includes a $formatter. (I store currency in pence for correctness, but display in pounds.pence.)

If the user types \'10\'

5条回答
  •  星月不相逢
    2020-12-24 14:58

    10.00 === 10 true

    a=10.00

    console.log(a) 10

    .00 don't means anything on javascript, because of this your 10.00 are becoming 10

    I suggest to make the value a String so you can create the format that you want

提交回复
热议问题