PowerToys/doc/devdocs/modules/launcher/plugins/calculator.md
Alekhya 0314b570cd
Dev Documentation of PowerToys Run (#7333)
* Architecture and  (#7267)

* Added debugging steps for PT Run

* Updated architecture markdown for launcher

* updated project architecture markdown for launcher

* Added telemetry docs for launcher

* Added the basic folder structure and files

* Added a basic overview of all common functionalities of the plugins

* Added information about the functioning of the calculator plugin

* update score section of overview

* added information about the uri plugin

* added info about the indexer plugin

* Added the documentation for the indexer plugin

* Added information about the program plugin

* Added info about the shell plugin

* updated some plugin info and added information about the ww plugin

* documenting the folder plugin

* updated window walker docs

* dev docs for the folder plugin

* added images to each of the plugins

* Added link to pt run documents

* fix typos and some minor corrections

* Add table of contents for pt run dev docs

* Fix image path and project link for Wox.plugin

Co-authored-by: Divyansh Srivastava <somm14divi@gmail.com>
2020-10-20 14:28:23 -07:00

1.2 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.