I\'m new to C++. I have a double variable double a=0.1239857 and I want to limit variable a from decimal point two digits. So a will b
double a=0.1239857
a
What do you mean by you want to limit the variable ? The value or its formatting. For the value, you can use floor + division. Something like:
double a = 0.12123 double b; b = floor(a * 100) / 100