mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-15 03:59:15 +08:00
1.3 KiB
1.3 KiB
Calculator Plugin
The Calculator plugin as the name suggests is used to perform calculations on the user entered query.
CalculateHelper
- The
CalculateHelper.cs
class checks to see if the user entered query is a valid input to the calculator and only if the input is valid does it perform the operation. - It does so by matching the user query to a valid regex.
CalculateEngine
- The main computation is done in the
CalculateEngine.cs
file using theMages
library.
var result = CalculateEngine.Interpret(query.Search, CultureInfo.CurrentUICulture);
CalculateResult
- The class which encapsulates the result of the computation.
- It comprises of the
Result
andRoundedResult
properties.
Score
The score of each result from the calculator plugin is 300
.