i need to "chop off" a 'double' so that he'll have 3 digits after the dot (not rounding, just cut everything else off).
Here is my code:
double multiply_by = (pow(10.0, _digits_percision));
_number = (_number * multiply_by);
_number = (int) _number;
_number = (_number / multiply_by);
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.