Skip to content

xuanzhi33/vscode-calculator

Repository files navigation

Calculator for VS Code

GitHub issues GitHub forks GitHub stars GitHub license

How to use

Start

To use the calculator, type calculator in the command palette.

You can also use key bindings to start the calculator quickly:

Windows: Ctrl+Alt+L

Mac: Cmd+Alt+L

Calculate

You can type a math expression into the input box to calculate, and the result will be displayed as a notification.

Examples of math expression:

  • 1 + 1
  • 1 - 1 * 2
  • 2**3+7*(3+1)
  • (1.1 + 7.4)/5

You can use JavaScript's Math library for more advanced calculations:

  • Math.sqrt(9)
  • Math.pow(2, 3)
  • Math.round(3.14)
  • Math.floor(3.14)
  • Math.abs(-3.14)
  • Math.min(1, 4, 9)
  • Math.random()
  • Math.PI
  • Math.sin(x)
  • ...

Tips

If you have selected some text in the editor when you open the calculator, the text will automatically appear in the input box for you to calculate.

Enjoy!

If you think it is useful, please star the repository, thank you.