Skip to content

A simple web calculator that allows basic arithmetic operations, including addition, subtraction, multiplication, and division. Supports decimal numbers and offers keyboard shortcuts for easy input. Try the live demo!

Notifications You must be signed in to change notification settings

marcft/calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Web Calculator

Welcome to the Web Calculator project! This is a simple web calculator that allows you to perform basic mathematical operations, including addition, subtraction, multiplication, and division. It also accepts decimal numbers for more precise calculations. The calculator's interface is divided into two parts: the upper display shows the ongoing operations, while the lower display shows the current number being entered. Additionally, if a result of an operation is too long, the calculator will truncate it to fit the display.

Features

  • Perform basic arithmetic operations: addition, subtraction, multiplication, and division.
  • Support for decimal numbers to handle more precise calculations.
  • Upper display shows the sequence of operations being performed.
  • Lower display shows the current number being entered.
  • Result truncation for long operation outputs to fit the display.
  • Delete button to remove a single digit in case of a misinput.
  • Clear button to remove all digits and reset the calculator.
  • Keyboard support for easy input without having to click the web buttons.

Demo

You can try out the live demo of the calculator here.

Keyboard Shortcuts

The calculator supports the following keyboard shortcuts for quick and efficient calculations:

  • Number keys (0-9): Enter digits using your keyboard to input numbers.
  • Decimal Point (.): Use the period key to input decimal numbers.
  • Addition (+): Press the plus key (+) to perform addition.
  • Subtraction (-): Press the minus key (-) to perform subtraction.
  • Multiplication (*): Press the asterisk key (*) to perform multiplication.
  • Division (/): Press the forward slash key (/) to perform division.
  • Equal (=): Press Enter or the equal sign (=) to display the result of the calculation.
  • Delete (DEL or Backspace): Press the delete key to remove a single digit.
  • Clear (C): Press the escape key or the letter 'C' to clear all digits and reset the calculator.

About

A simple web calculator that allows basic arithmetic operations, including addition, subtraction, multiplication, and division. Supports decimal numbers and offers keyboard shortcuts for easy input. Try the live demo!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published