Help with the calculator

Help with the calculator

Příspěvekod jensenbreck » sob 30. pro 2017 12:54:15

Hi,
I have been working on my calculator for about two weeks now. I got most of the functionality down pretty fast, but am stuck on two thing.

Currently a user cannot input two consecutive dots, but they can do something like this 1.2.3 + 5. How can I prevent that from happening?

After user gets a total , if they press a number, that number just gets tacked on to the back of the total. So, if the total is 12, and the user presses 3, they have 123 in the input field, and fututre calculations are performed on 123. I want it to be so that when the user presser a number, it resets the calculator to that number. So if your total is 12 and you press + 3, you get 15, but if you just press 3, all future calculations will be preformed on 3.

Please let me know if I didn’t explain the issues well?

Please help.
Thanks!
I didn't find the right solution from the Internet.
References:https://forum.freecodecamp.org/t/help-with-the-calculator/165960

Animated video for business
jensenbreck
 
Příspěvky: 38
Registrován: stř 01. lis 2017 7:27:11

Zpět na Tábor

Kdo je online

Uživatelé procházející toto fórum: Žádní registrovaní uživatelé a 6 návštevníků

cron