title: Float to string without rounding
body: <p>I wanted to extract decimal places from decimal number. Not that hard, right?</p>
  
  <p>So, I converted float to string. </p>
  
  <p>Then, I used <code>substr()</code> to crop the string starting from <code>string.find('.')+1</code>, till the end.</p>
  
  <p>Well.... the problem is here. When we have a number like this: <code>5.7741589</code>, it's not "precise" that much, it's actually: <code>5.774159</code></p>
  
  <p>If it round itself, I can't precisely get the number of decimal places... So question is:</p>
  
  <p>How can I convert decimal number to string, without rounding it?</p>
  
  <p>EDIT: Since a lot of people are asking for actual input and output and code, here it is:</p>
  
  <pre><code>Input: 5.7741589
  Output (let's say we want to output just decimal places): 7741589
  Output (not expected one): 774159
  </code></pre>
  
  <p>Code:</p>
  
  <pre><code>float num;
  cin&gt;&gt;num;
  string s = to_string(num);
  s = s.substr(s.find('.')+1,s.length());
  cout&lt;&lt;s&lt;&lt;endl;
  </code></pre>
  
  <p>EDIT2: One more thing. I need this for competitive programming, I can do this exercise with input as string. Imagine you have problem where you have 2 decimal numbers, you need to multiply them and then count number of decimal places. Then you again lose decimal places which is problem.</p>