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)