<!DOCTYPE html>

          input[type=number] {
               height: 25px;
               border: 1px solid #234fc4;
               height: 30px;width: 100px;
               border: 1px solid #234fc4;
     <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.13/angular.js"></script>
          var app = angular.module("myApp", []);
          app.controller("myCtrl", function($scope) {
               $scope.IsValid = function() {
                    alert("Price Is valid and form  is submitted.");

<body ng-app="myApp">
     <div ng-controller="formCtrl">
          <h2>Use ng-pattern to validate in AngularJs</h2>
          <form name="valForm" ng-submit="IsValid()">
               <input type="number" ng-model="val" name="val" ng-pattern="/^\d{0,9}(\.\d{1,9})?$/" required>
               <input class="button" type="submit" value="submit" />

// Code goes here

/* Styles go here */