title: How to stop doubles converting to scientific notation when using a stringstream
body: <p>I'm making a function to return the number of decimal and whole number digits and am converting the inserted <code>typename</code> number to a string using <code>sstream</code>s. </p>
  
  <p>However the number when being converted to a string comes out in scientific notations which is not useful for counting the number of digits are in the normal number. How can I stop this from happening in my function below?</p>
  
  <pre><code>enum { DECIMALS = 10, WHOLE_NUMBS = 20, ALL = 30 };
  
  template &lt; typename T &gt; int Numbs_Digits(T numb, int scope)
  {
      stringstream ss(stringstream::in | stringstream::out);
      stringstream ss2(stringstream::in | stringstream::out);
      unsigned long int length = 0;
      unsigned long int numb_wholes;
  
      ss2 &lt;&lt; (int) numb;
      numb_wholes = ss2.str().length();
      ss2.flush();
      bool all = false;
  
      switch (scope) {
      case ALL:
          all = true;
  
      case DECIMALS:
          ss &lt;&lt; numb;
          length += ss.str().length() - (numb_wholes + 1);  // +1 for the "."
          if (all != true)
              break;
  
      case WHOLE_NUMBS:
          length += numb_wholes;
          if (all != true)
              break;
  
      default:
          break;
      }
      return length;
  }
  </code></pre>