Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/pavlevujicic/calculator-miniproj
Simple and intuitive calculator built using React.
https://github.com/pavlevujicic/calculator-miniproj
css javascript jsx reactjs
Last synced: 26 days ago
JSON representation
Simple and intuitive calculator built using React.
- Host: GitHub
- URL: https://github.com/pavlevujicic/calculator-miniproj
- Owner: PavleVujicic
- Created: 2024-08-27T22:43:03.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-09-04T00:39:48.000Z (2 months ago)
- Last Synced: 2024-10-11T05:41:27.584Z (26 days ago)
- Topics: css, javascript, jsx, reactjs
- Language: JavaScript
- Homepage: https://pavle-calculator.web.app
- Size: 205 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pavle's Calculator App
Welcome to **Pavle's Calculator App**, a simple and intuitive calculator built using React. This app allows users to perform basic arithmetic operations with real-time evaluation of expressions.
## Features
- **Basic Operations**: Supports addition, subtraction, multiplication, and division.
- **Real-time Evaluation**: The app evaluates the expression as you type, displaying the result dynamically.
- **Error Prevention**: Prevents invalid expressions, such as consecutive operators, ensuring smooth and error-free calculations.
- **Delete Functionality**: Easily remove the last character entered to correct mistakes.
- **Responsive Design**: User-friendly and adaptable to different screen sizes.## How It Works
- **State Management**: The app maintains two states: `calc` for the current input expression and `result` for the evaluated result.
- **Operators**: A set of operators (`/`, `*`, `+`, `-`, `.`) is defined to manage input logic and prevent invalid expressions.
- **Display**: The current expression and real-time result (enclosed in parentheses) are shown on the display.
- **Digit Buttons**: Digits (1-9) are dynamically generated, updating the expression with each button click.
- **Calculation**: The `=` button finalizes the expression and displays the result.
- **Delete**: The `DEL` button allows users to remove the last entered character.## Usage
- Click on the digit buttons to input numbers.
- Use the operator buttons (`/`, `*`, `+`, `-`) to perform arithmetic operations.
- The result is displayed in real-time as you input the expression.
- Press `=` to finalize the calculation.
- Use `DEL` to delete the last character.