Skip to content

hammerztein/odin-calc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 

Repository files navigation

The Odin Project - Calculator

This is a simple calculator app built for The Odin Project foundations course.

Assignment

Create a calculator app with UI (buttons and screen) that will have all of the basic math operations (addition, subtraction, multiplication and division). Calculator should not evaluate more then a single pair of numbers at a time. Do not use built-in eval() function.

ADDITIONAL

Calculator should have keyboard support (with 'Backspace' for delete and 'DEL' for clear) and users should be able to add decimal point.

Links

Live app preview

Things I Used

  • data-* attributes
  • Flex box layout
  • Event delegation
  • Functional programming

What I Learned

  • Parsing float numbers to certain decimal places
  • Functional programming
  • Using different event types
  • How to de-focus an element

Acknowledgments

Used this Stack Overflow question to find out how to round up float point numbers correctly.

Used this MDN Event documentation to figure out why I needed to use event.blur and check for event.type before assigning either event.dataset.value or event.key

About

A Calculator Project For The Odin Project Curriculum

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published