Im new to Angular 2 and i wa wondering if there is a way to restict and amount field to only allow 2 decimal places.
I have tried the below as i have read a few places it should work but i cant seem get it to.
<input id="amountfield" ng-model="vm.transferdetails.Amount" ng-model-options="{ updateOn:'blur' }" ng-pattern="/^[0-9]+(\.[0-9]{1,2})?$/" step="0.01">
If i have to use a directive, what do i need and also can it be formatted with , (commas) for thousands (e.g. 100,000,000.00) when you tab out the field. Only really intrested in this though if i have to use a directive
答案 0 :(得分:1)
以下是我认为可以帮助您的输入。在另一篇文章中回答: