Javascript calculator built with HTML,CSS, Javascript, JQuery and Bootstrap. Check it out here Live Demo
HTML
CSS, Bootstrap
JavaScript, jQuery
In any order, I should be able to
add
,subtract
,multiply
anddivide
a chain of numbers ofany length
, and when I hit=
, the correct result should be shown.
When inputting numbers, my calculator should not allow a number to
begin
withmultiple zeros
.
When the
decimal
element is clicked, a.
should append to the currently displayed value;two
.
in one number should not be accepted.
I should be able to perform any operation (+, -, *, /) on numbers containing
decimal points
.
If 2 or more operators are entered consecutively, the operation performed should be the last operator entered (excluding the negative (-) sign). For example, if
5 + * 7 =
is entered, the result should be35
(i.e. 5 * 7); if5 * - 5 =
is entered, the result should be-25
(i.e. 5 x (-5)).
Pressing an operator immediately following
=
should start anew calculation
that operates on the result of theprevious
evaluation.
My calculator should have several decimal places of precision when it comes to rounding (note that there is no exact standard, but you should be able to handle calculations like
2 / 7
with reasonable precision to at least 4 decimal places).
-
Clone this repo to your local machine using
git clone https://github.com/muzhaqi16/javascript-calculator.git
-
Go inside the new folder that was cloned into
javascript-calculator
-
Open
index.html
with your favourite browser
I would love your contribution at making this repo better and adding new features. To get started at contributing at this repo follow the steps below...
-
Option 1
- 🍴 Fork this repo!
-
Option 2
- 👯 Clone this repo to your local machine using
https://github.com/muzhaqi16/javascript-calculator.git
- 👯 Clone this repo to your local machine using
- HACK AWAY! 🔨🔨🔨
- 🔃 Create a new pull request using
https://github.com/muzhaqi16/javascript-calculator.git/compare
.
- MIT license
- Copyright 2020 © Artan Muzhaqi.