convert string to number javscript code example
Example 1: convert string to number javascript
var myString = "869.99"
var myFloat = parseFloat(myString)
var myInt = parseInt(myString)
Example 2: javascript string to a decimal
<script language="JavaScript" type="text/javascript">
var a = "3.3445";
var c = parseFloat(a);
alert(c);
</script>
Example 3: javascript type casting int
Number("3.14")
false.toString()
String(false)
Example 4: string to number javascript
new Number(valeur);
var a = new Number('123');
var b = Number('123');
a instanceof Number;
b instanceof Number;