Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to get the integer part of a string in javascript

  str1 = "test123.00".replace ( /[^d.]/g, '' );
  str2 = "yes50.00".replace ( /[^d.]/g, '' );
  total = parseInt(str1, 10) + parseInt(str2, 10);
  alert(total);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #integer #part #string #javascript
ADD COMMENT
Topic
Name
5+4 =