Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

parseInt Javascript

let str = '24.5'
let numberVariable = parseInt(str, 10)
// numberVariable = 24 (of type Number)

//Format
parseInt(string, base)
// To get the decimal value also (24.5), use parseFloat(string)
 
PREVIOUS NEXT
Tagged: #parseInt #Javascript
ADD COMMENT
Topic
Name
3+4 =