Giter Site home page Giter Site logo

vanilla-javascript-calculator's People

Contributors

webdevsimplified avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vanilla-javascript-calculator's Issues

Line 19 is missing .toString()

`if (number === '.' && this.currentOperand.includes('.')) return`  

should be
if (number === '.' && this.currentOperand.toString().includes('.')) return

otherwise, appending a dot is not possible after a equalsButton compute()

Negative number as first input

I noticed that the calculator cannot process negative number as first input.

I tried to built the feature, but after hours and hours of trial and error, i yield.
this task is beyond my scope of understanding, i someone with more experience
try to built it ?

it would really help me an others that recently learning to code and want to dive deeper
in the universe.

best regards,
rshanTD

adding keypress

I want to add keypress in the calculator. so that if someone presses numbers from keyboard also it should work.
Please assign me this task so can i start working on it.

Change the Previous Operation to New Operation

When we have selected an operation to Compute the result we can't change it to another Operation. The only way is to either clear or evaluate.

Steps to Replicate the issue

  1. Add any Number Input
  2. Select any operation (say +)
  3. Try to change the operation ( we can't change the + to any other operation)

wrong results

0.1 + 0.2 and dividing by zero are giving the incorrect result. I know it is a JS fault, but I was hoping to find a solution here.

Divide by zero solution

case '÷': if(curr == '0') { compute = '0'; } else{ compute = prev / curr; } break;

Cannot add an error message because for divide by zero as we are using getDisplayNumber() method to edit current operand. Hope this works

Bug

It didn't work

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.