logo
Search
showing results for - "how to get the integer part of a string in javascript"
Klara
22 Mar 2019
1  str1 = "test123.00".replace ( /[^\d.]/g, '' );
2  str2 = "yes50.00".replace ( /[^\d.]/g, '' );
3  total = parseInt(str1, 10) + parseInt(str2, 10);
4  alert(total);
5
source
similar questions
calculate string value in javascriptjavascript convert number to stringjavascript extract number from stringhow set type of string value to number in jsint to string jshow to convert a number to a string in javascriptjavascript integer to stringget number from string javascriptnumber to string javascripthow to turn number into string javascriptint to string javascriptjavascript is a string numbericjavascript find a digit in strjs extract only numbers from stringjs int to string basejavascript convert a number in stringhow to find number in string javascriptjavascript strings and numbersjs cast a number into a stringjs numbers only stringconverst strig in number in jsjs int to stringjavascript number to stringjs get number from string
queries leading to this page
how to take the integer part of a string jshow to get the integer part of a string in javascript
privacy policyterms of useinstagram
Crafted with  ♥  for everyone

sign in to continue
your answer for
you will get a confirmation link on this - you will have to click that for successful submission of your answer. we require this to keep the website free of spam, bots and unhelpful content
please ensure to add code which is syntactically corrent and executes properly
sign in to continue
ask question on maxinterview
you will get a confirmation link on this - you will have to click that for successful submission of your question. we require this to keep the website free of spam, bots and unhelpful content
please be clear, to the point and respectful
sign in to continue