DhanushNehru / calculator

An online calculator
https://calculator-dhanushnehru.netlify.app/
MIT License
24 stars 75 forks source link

Add validation to prevent consecutive invalid operators #98

Closed SavainB closed 1 year ago

SavainB commented 1 year ago

The function now includes additional logic to prevent users from entering consecutive invalid operators. This ensures that operators like +, -, *, and / are not entered one after another. The function checks the recent operators in the string and the parameter, returning the as is if two consecutive operators are detected. This commit enhances the functionality and improves the user experience by enforcing valid operator input.

Modified function: verification(displayText, new_caracter)

netlify[bot] commented 1 year ago

Deploy Preview for calculator-dhanushnehru ready!

Name Link
Latest commit 7c2f58480706dc9322b5d0579090ac9b10b6be4a
Latest deploy log https://app.netlify.com/sites/calculator-dhanushnehru/deploys/647760e17b836500083b199f
Deploy Preview https://deploy-preview-98--calculator-dhanushnehru.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

DhanushNehru commented 1 year ago

Hey @SavainB on giving this it throws syntax error, please check that

Screenshot 2023-05-31 at 7 04 53 PM