Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Extract number from string javascripy

function justNumbers(string) {
  var numsStr = string.replace(/[^0-9]/g, '');
  return parseInt(numsStr);
}

var input = "Rs. 6,67,000";
var number = justNumbers(input);
console.log(number); // 667000
 Run code snippet
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Extract #number #string #javascripy
ADD COMMENT
Topic
Name
2+5 =