I have a self made stack and I'm writing a method push() for it. I am pushing one number to the stack, sometimes it's int and sometimes it's double. When it's double, I've got another variable saying what precision it should have (how many numbers after coma).
Let's say I've got variables d = 7,39518 and prec = 3, can I somehow set precision of d to value of prec so the outcome is that value of d = 7,395?
I know how to do it for couting, but how to change the actual variable?