I searched around and couldn\'t find the trunc function for C++. I know I can do this:
trunc
int main() { double a = 12.566789; cout <<
Sure. Use the trunc() function from math.h. It's a C function, but it works as well in C++ as it does in C. If you want to keep a couple digits, you can always:
trunc()
double a = 12.566789; double b = trunc(a * 100) / 100.0;