regex angular for adding decimal number upto 2 places code example Example: regex validate double with 2 decimals ^(\d+(\.\d{0,2})?|\.?\d{1,2})$