A lightweight Visual Studio Code extension that calculates mathematical expressions and inserts the result at your cursor position. Perfect for quick calculations without leaving your code editor.
✨ Features
🔢 Calculate mathematical expressions directly in VS Code
🎯 Insert results at cursor position with a single command
⚡ Fast and lightweight - no external dependencies required
🛡️ Safe evaluation - uses secure expression parsing (no eval())
📋 Supports common operators: +, -, *, /, %, ^, ()
⌨️ Keyboard shortcut support for quick access
📦 Installation
From VS Code Marketplace
Open Extensions view in VS Code (Ctrl+Shift+X)
Search for "Calculator Extension"
Click Install
Reload VS Code if prompted
From VSIX File
Download the .vsix file from releases
Open VS Code and go to Extensions view
Click the ... menu and select Install from VSIX...
Select the downloaded file and install
🚀 Usage
Basic Calculation
Place your cursor where you want the result inserted
Open Command Palette (Ctrl+Shift+P)
Type Calculate and press Enter
Enter your mathematical expression (e.g., 2+3*4)
Press Enter to calculate and insert the result
Example Expressions
2+3*4 → 14
(2+3)*4 → 20
10/3 → 3.333...
2^8 → 256
sqrt(9) → 3
Keyboard Shortcut
You can add a custom keyboard shortcut in your keybindings.json: