This extension uses the incredibly powerful Qalculate! to bring quick, powerful mathematical expression evaluation and calculation to VSCode.
If you're an engineer that works with physical quantities this extension is your new best friend.
Using the extension is short and sweet. You can run qalc on the current selection / line through the command palette.
Even better, you can run qalc and replace the current selection / line with the command palette or the keyboard shortcut ⌘ + ⇧ + / (Mac) or ⌃ + ⇧ + / (Windows / Linux).
The extension is clever enough that you can run the command on Markdown inline code blocks (`like this`
), so it's fantastic for writing!
The real power comes from qalc
- It is an extremely powerful calculator and you'll definitely want to check out the manual if you want to learn everything about it.
You must have Qalculate! installed. It's not hard, I promise.
If you're on a Mac, use homebrew:
brew install qalculate-gtk
If you're on Windows or Linux, head over to the Qalculate! downloads page where you can snag pre-built binaries as well as the source code, if you're into that sort of thing.
Qalc has just one VSCode setting, calc.settings
. It's a list of set
commands which it passes along to qalc
. There's a full list of settings on the qalc
man page.
For example:
"qalc.settings": [
"base 16",
"divsign 2",
]
Would cause qalc
to use hexadecimal and the division sign (÷
) when displaying results:
# input
16/2
# before
16 ∕ 2 = 8
# after
16 ÷ 2 = 0x8
This extension uses Qalculate! for evaluating your expressions- so if you run into trouble that's the first place to start.
This extension is licensed under the MIT License and contributions are welcome!.