Chopping of digits (after the dot) in C++
<p>i need to "chop off" a 'double' so that he'll have 3 digits after the dot (not rounding, just cut everything else off).</p>

<p>Here is my code:</p>

<pre><code>double multiply_by = (pow(10.0, _digits_percision));
_number = (_number * multiply_by);
_number = (int) _number;
_number = (_number / multiply_by);
</code></pre>

<p>When i'm inputing 1.001, my output (after performing this code) is 1.
When my input is 1.007, my output is 1.006.
It happens only with 1.xxx
Any ideas?
Thanks.</p>
