Тэги:
#webdev #javascript #css #sass #scss #js #vuejs #vue #reactjs #website_development #website_design #app_dev #app #app_design #app_development #mobile_app #native #web_developer #app_developer #developer #programmerКомментарии:
remember to include this in your ValidateInput function to prevent users from entering multiple % sign.
if (value == "%" && last_input == "%") {
return false;
}
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('');
}
💞💞💞💞💞💞💞💓💓💓💓💕💓💓💓💓💓💓💓💕💓💓💕💓💓💓💓💓💓💓💓💓💓💓💓💓 well done
ОтветитьThanks for sharing it really helps :-)
ОтветитьVery useful, video,, . , ❤. I enjoyed the logics, this is one of the best beginners project
ОтветитьTime stamps would have been so much helpful >>>
ОтветитьAwesome video and great sense of humour too
Ответитьone thing i noticed is when a decimal is too large, the output goes a little off screen
ОтветитьUse toLocaleString() function on input, it will separate the result number with comma
Ответить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.
Ответить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
ОтветитьVery useful. Thanks
ОтветитьThank you very much for your video. How can I save data to localstorage?
Ответитьjust use live server in vs-Code to see live preview of your code .
ОтветитьGreat tutorial sir! 💚
Ответитьwhat's ur vscode theme?
Ответитьpress option + ?get ➗
ОтветитьThis is by far the best channel with great mini projects for getting better at coding. Tyler Potts is the best.
Ответить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.
Ответить