Answers for "get the number from string javascript"

122

string to number js

var myInt = parseInt("10.256"); //10
var myFloat = parseFloat("10.256"); //10.256
Posted by: Guest on July-23-2019
3

js get number from string

thenum = "foo3bar5".match(/\d+/)[0] // "3"
Posted by: Guest on January-08-2021
2

javascript extract number from string

// Html: <span id="foo">280ms</span>

var text = $('#foo').text();
var number = parseInt(text, 10);
alert(number);

// parseInt('ms120'.replace(/[^0-9\.]/g, ''), 10);
Posted by: Guest on May-06-2020

Code answers related to "get the number from string javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language