-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels