Answers for "how to convert string in number with parseInt function"

122

parse integer javascript

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

Use parseInt() in the convertToInteger function so it converts the input string str into an integer, and returns it.

function convertToInteger(str) {
  return parseInt(str);
}
Posted by: Guest on December-19-2019

Code answers related to "how to convert string in number with parseInt function"

Code answers related to "Javascript"

Browse Popular Code Answers by Language