In case nobody noticed, if the first number is 0 then the calculation will be completely wrong, for example 021 + 2 will return 19 when it should be 23. Make sure to correct the typo in the "PerpareInput" function that he wrote then just replace the entire PrepareInput function with this function PrepareInput(input) { // Replace percentages with their decimal equivalent let preparedInput = input.replace(/%/g, "/100"); // Split the input into individual tokens let tokens = preparedInput.match(/(\d+\.\d+|\d+|\S)/g) || []; // Process each token to remove leading zeros in numbers for (let i = 0; i < tokens.length; i++) { if (!isNaN(tokens[i]) && tokens[i][0] === '0' && tokens[i].length > 1 && tokens[i][1] !== '.') { tokens[i] = tokens[i].replace(/^0+/, ''); } } return tokens.join(''); }
I've learned so much from this video and the todo list video! I had a question on how to store those tasks from your todo vid. Hopefully you got the email.
remember to include this in your ValidateInput function to prevent users from entering multiple % sign. if (value == "%" && last_input == "%") { return false; }
it didn't work for me .. i mean the timer is not working ... neither in my local laptop nor in the server .. wonder why ... because i just downloaded the whole folder from github and tested it.
when I opened the index htmp it didn't show me the numbers etc.. and when I recheck my code I did exactly the same things, can u help me know where I must've went wrong?
i've come across this problem where user can input multiple decimal. i've tried to optimize the validateinput to if( value == "." && last_input == "." || value == "." && input.lastIndexOf(operators)
This is by far the best channel with great mini projects for getting better at coding. Tyler Potts is the best.
Excellent tutorial, In addition to basic JS stuff, shows how to manipulate inputs, using various string methods. Thank you.
Great tutorial sir! 💚
In case nobody noticed, if the first number is 0 then the calculation will be completely wrong, for example 021 + 2 will return 19 when it should be 23. Make sure to correct the typo in the "PerpareInput" function that he wrote then just replace the entire PrepareInput function with this
function PrepareInput(input) {
// Replace percentages with their decimal equivalent
let preparedInput = input.replace(/%/g, "/100");
// Split the input into individual tokens
let tokens = preparedInput.match(/(\d+\.\d+|\d+|\S)/g) || [];
// Process each token to remove leading zeros in numbers
for (let i = 0; i < tokens.length; i++) {
if (!isNaN(tokens[i]) && tokens[i][0] === '0' && tokens[i].length > 1 && tokens[i][1] !== '.') {
tokens[i] = tokens[i].replace(/^0+/, '');
}
}
return tokens.join('');
}
sry mate i cant understand ur code, can u explain it?
22:25 ~ js part
03:32 ~ Html Divs
06:07 ~ Css Start
Awesome video and great sense of humour too
Very useful, video,, . , ❤. I enjoyed the logics, this is one of the best beginners project
I've learned so much from this video and the todo list video! I had a question on how to store those tasks from your todo vid. Hopefully you got the email.
Very useful. Thanks
Thanks for sharing it really helps :-)
remember to include this in your ValidateInput function to prevent users from entering multiple % sign.
if (value == "%" && last_input == "%") {
return false;
}
after which part do you put this at
What is your app to programming
it didn't work for me .. i mean the timer is not working ... neither in my local laptop nor in the server .. wonder why ... because i just downloaded the whole folder from github and tested it.
Probaly bugs
one thing i noticed is when a decimal is too large, the output goes a little off screen
1 ÷ 0
In,fin,ity
Thank you very much for your video. How can I save data to localstorage?
I have a few videos on localstorage on my channel! Hopefully they can help.
when I opened the index htmp it didn't show me the numbers etc.. and when I recheck my code I did exactly the same things, can u help me know where I must've went wrong?
same here
@@Arebamasrura_z i think u should save the files in order to see changes!
for the css part, when i clicked ctrl+s to save it and i went to my html file thingy, i didnt see anything save
Time stamps would have been so much helpful >>>
20:06
i've come across this problem where user can input multiple decimal. i've tried to optimize the validateinput to
if( value == "." && last_input == "." || value == "." && input.lastIndexOf(operators)
I turned 3 minutes into 40 minutes 😂 and this vid is not for slow type people to make😅
13:58
How do I delete my account
what's ur vscode theme?
F
SynthWave '84
press option + ?get ➗