title: Getting the decimal part of a number stored as string
body: <p>The program I'm currently making requires me to store large floating-point numbers. I'm storing them as strings, which is working fine (of course I had to overload some operators that I needed) (I'm not allowed to use any multi-precision arithmetic library). Right now I'm looking for a way to get the decimal part of a number and also store it as a string. I thought about using stringstream and ignore, but that doesn't seem to be working. Is there something wrong in my code, as this doesn't do anything? Or is there some other method to achieve it (I was also thinking about a loop that would iterate through the stream until a dot, would that work?)</p>
  
  <pre><code>string toDecimal(string x)
  {
  string decimalValue;
  stringstream x2(x);
  x2 &gt;&gt; x;
  x2.ignore(100, '.'); //it can have up to 100 places before the dot
  decimalValue = x2.str();
  cout &lt;&lt; decimalValue &lt;&lt; end;
  return decimalValue;
  }
  </code></pre>
  
  <p>What I'm trying to achieve is to get this:</p>
  
  <pre><code> 18432184831754814758755551223184764301982441
  </code></pre>
  
  <p>from this:</p>
  
  <pre><code> 18432184831754814758755551223184764301982441.4321432154
  </code></pre>