You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The PercentageKey method is meant to calculate a percentage of number1 and then apply that percentage via either
addition ,subtraction, multiplication, or division. As coded the division operator does not do this.
Current behavior
The PercentageKey method is meant to calculate a percentage of number1 and then apply that percentage via either
addition ,subtraction, multiplication, or division. As coded the division operator does not do this.
"÷" => calculator.Number1!.Value / (number2!.Value / 100) * calculator.Number1!.Value
To get the correct behavior an extra set of parentheses is needed
"÷" => calculator.Number1!.Value /( (number2!.Value / 100) * calculator.Number1!.Value)
For example say number1 = 45 and number2 = 10
as coded: 45/.145 = 20250
modified : 45/(.145) = 10
For addition, subtraction, and multiplication normal operator precedence produces the expected result.
The text was updated successfully, but these errors were encountered: