This project is the capstone for The Odin Project Foundation module.
Itโs a simple calculator built entirely from HTML, CSS, and JavaScript โ no libraries, no frameworks.
- UI built with Flexbox โ arranging the buttons and display was fun and helped solidify my layout skills.
- State management for operands and operators โ handles multiple operations in sequence (chained calculations) without needing to clear between each one.
- Smart number formatting โ large, small, and long decimal numbers are displayed neatly using
toExponential()
andtoPrecision()
.
- Managing state so the calculator works correctly for chained operations.
- Preventing display overflow while keeping results accurate and readable.
- Handling a mix of integers, decimals, and scientific notation without breaking the UI.
- Click the on-screen buttons to enter numbers and operators.
- Perform a calculation:
- Example:
12 ร 3 = 36
- Example:
- Continue calculations without clearing โ results are carried forward automatically.
- Use the AC button to reset the calculator.
This was a challenging but rewarding project that pulled together everything Iโve learned in this module โ from JavaScript logic to CSS layout and DOM manipulation.
It was a great test of my ability to manage state, format output dynamically, and make the UI responsive and user-friendly.