0

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

1 Answer 1

1

Here is the input I think will help you. It was answered in a different post:

Number pipes in Angular2 not working as I would expect

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.