I have wasted a lot of time on this already :(.
I want to accept only the integer or the double-positive numbers:
ex:
40000, 500.0000, 400.1234
I managed to do that for the integers:
// somewhere at the code
export const NUMERIC_PATTREN = '^-?[0-9]\\d*(\\.\\d{1,2})?$';
// component code:
amount: [{ value: entry.amount, disabled: false }, [Validators.required,Validators.pattern(NUMERIC_PATTREN )]],
However, the input is not accepting values from the format 500.0000 or 400.1234.
can anybody help me figure this out please.
Update I want to limit the number of places after the point too.