What I'm trying to do is take the user given input (operand) and round my current number to the amount of decimals that the operand is. For example if my current number in the calculator program this is running on is 15.44876, and the user input is 2, I would like the returned value to be 15.45, or just 15.44 at least.
public double round(double operand){
this.answer = Math.round(this.answer, operand);
return this.answer;
I know the code above is incorrect, but it's just a place holder since I'm pretty confused on this.