Mozzarella

Home

SelectCalc

This add-on lets you calculate mathematical expressions in input fields and text areas. To use, simply select the expression you want to calculate and press Ctrl + Alt + e (Command + Option + e on macOS). (You can also right-click and choose SelectCalc.) The selection will be replaced with the result.


Expression Syntax

You can use most common operators and many common functions, and the constants pi, e, and au. A full list of operators and functions may be found here, but be aware of the following differences:


For ease of use, some aliases are available:

Some extra constants and functions are available:

Any invalid character will be removed from the expression before evaluating it, so for example, if you select that 2 + 2 = 5 is the archetypical untruth, that entire string would be replaced with 0. (This doesn't always result in a successful calculation; e.g. The square root of 4 is sqrt(4), not 1 will not work, but The square root of four is sqrt(4) and not one will work.)


License

This add-on is free software released under the X11 License. Its source code may be found on GitLab. All data is processed on your own device (i.e. not sent anywhere) and no tracking or analytics scripts are used.


DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Notes

Using SelectCalc removes the undo history for the field or text area where you used it. This is a browser bug and not something I can fix.

This add-on contains an easter egg that acts on certain expressions related to Nineteen Eighty-Four. This easter egg will not run unless you evaluate the string "O'Brien's SelectCalc" immediately prior. (Evaluating oBrien will insert that string; you would then need to evaluate a second time for the easter egg to run.)

Install