+ 2

How to convert String to number? And number to String?

need answer

30th Dec 2016, 8:04 AM
Saleh Sayeem
Saleh Sayeem - avatar
3 Antworten
+ 4
With the parseInt(), parseFloat() functions and toString() method ^^ var t = "42.0"; var f = parseFloat(t); var i = 42; var s = i.toString();
30th Dec 2016, 8:08 AM
visph
visph - avatar
0
Thank you :)
30th Dec 2016, 8:11 AM
Saleh Sayeem
Saleh Sayeem - avatar
0
var num1 = "43.76"; num1 = +num1;// 43.76 var num2 = 43.76; num2 = "" + num2;// "43.76"
30th Dec 2016, 1:54 PM
zakaria mouhid
zakaria mouhid - avatar