Skip to content

thetramp22/calculator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Calculator

The project is the final assignment in the Foundations Course on The Odin Project. The full assignment instructions can be found here.

Project

Live Demo

Find a live demo of the project here.

Screenshot

Process

Things I learned

I had a lot of trouble early in this project becaue I was stubbornly trying to make everything work inside of one or two large functions. After some headache and some research I broke everything into smaller, easier to understand functions and progress went much smoother.

Update

After sharing my project on The Odin Project discord channel I was made aware that the display would overflow if you entered more than 18 digits. I saw some other projects that seemed to use css to keep the overflow inside the box and hide it, but I figured that a calculator with such basic functions really didn't need to use numbers that large. I made a fundtion in the script to limit the entries after 18 digits.

function display(toBeDisplayed) {
    currentDisplay.innerText = toBeDisplayed;
    if(currentDisplay.innerText.toString().length > 18) {
        currentDisplay.innerText = currentDisplay.innerText.toString().slice(0, -1);
    }
}

Big thanks to user DreamVenerable in the discord channel for pointing that out.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published