title: function to validate million works fine. Need to ensure if it is the best way
body: <p>I have written a function to validate if a number is million and if million call the pipe that sets the number to two decimal places. The function works absolutely fine but need to ensure if it is the best way to do it</p>
  
  <p>function call</p>
  
  <pre><code>let points = this.points;
      isMillionNumber = validateMillionNumber(points[0].point.high);
  
      txt = '&lt;strong style="font-size:12px;color:' + points[0].point.color + '"&gt;' + points[0].point.name + '&lt;/strong&gt;&lt;br&gt;&lt;br&gt;&lt;table&gt;';
  
      if (isMillionNumber)
          value = shortNumberFormatPipe.transform(points[0].point.high, 2);
      else
          value = shortNumberFormatPipe.transform(points[0].point.high, 0);
  </code></pre>
  
  <p>function to validate million</p>
  
  <pre><code>function validateMillionNumber(millionNumber: number) {
      let  number = millionNumber.toString();
      var res = number.split(".");
      //check of the number contains decimals
  
      if (res.length &gt; 1) {
          number = number.toString().split(".")[0];
          // check the length of the number
          if (number.length &gt;= 7)
              return true;
          else
              return false;
      } else {
          if (number.length &gt;= 7)
              return true;
          else
              return false;
      }
  
  }
  </code></pre>