Round down / truncate (corresponds to Pascal Kirisute)
double kirisute(double x, int n) { x = x * pow(10, n - 1); x = x.truncateToDouble(); return x * pow(10, 1 - n).toDouble(); }