VBScript CInt 函数

CInt 函数把表达式转换为整数(Integer)类型。
注意:值必须是介于 -32768 与 32767 之间的数字。
语法
CInt(expression)
参数 | 描述 |
---|---|
expression | 必需。任何有效的表达式。 |
实例代码
<script type="text/vbscript">
document.write(CInt("300") & "<br />")
document.write(CInt(36.75) & "<br />")
document.write(CInt(-67) & "<br />")
</script>
document.write(CInt("300") & "<br />")
document.write(CInt(36.75) & "<br />")
document.write(CInt(-67) & "<br />")
</script>
以上实例输出结果:
300
37
-67
37
-67
