parseFloat

2017-06-14 16:05:00
admin
原创
598
<!DOCTYPE html>
<html>
	<head>
		<title>
			Number Example 9
		</title>
		<script type="text/javascript">
			var num1 = parseFloat("1234blue"); //1234 - integer
			var num2 = parseFloat("0xA"); //0
			var num3 = parseFloat("22.5"); //22.5
			var num4 = parseFloat("22.34.5"); //22.34
			var num5 = parseFloat("0908.5"); //908.5
			var num6 = parseFloat("3.125e7"); //31250000
			alert(num1);
			alert(num2);
			alert(num3);
			alert(num4);
			alert(num5);
			alert(num6);
		</script>
	</head>
	<body>
	</body>
</html>
  • QQ讨论群
  • 关注微信
    • 欢迎咨询
    • 欢迎加入QQ群 16506021
  • 公众号:源宝网络