This i what I am trying to achieve:
If a double has more than 3 decimal places, I want to truncate any decimal places beyond the third. (do not round.)
In C lang:
double truncKeepDecimalPlaces(double value, int numDecimals) { int x = pow(10, numDecimals); return (double)trunc(value * x) / x; }