PowerToys/doc/devdocs/modules/launcher/plugins/calculator.md

1.3 KiB

Calculator Plugin

The Calculator plugin as the name suggests is used to perform calculations on the user entered query.

Image of Calculator plugin

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

var result = CalculateEngine.Interpret(query.Search, CultureInfo.CurrentUICulture);

CalculateResult

  • The class which encapsulates the result of the computation.
  • It comprises of the Result and RoundedResult properties.

Score

The score of each result from the calculator plugin is 300.