VBScript Int function
Int function returns the integer portion of the specified number.
Note: If thenumber parameter contains Null, returns Null.
Tip: See the Fix function.
grammar
Int(number)
参数 | 描述 |
---|---|
number | 必需。有效的数值表达式。 |
Examples
Example 1
<script type="text/vbscript">
document.write(Int(6.83227) & "<br />")
document.write(Int(6.23443))
</script>
document.write(Int(6.83227) & "<br />")
document.write(Int(6.23443))
</script>
Examples of the above output:
6
6
6
try it"
Example 2
<script type="text/vbscript">
document.write(Int(-6.13443) & "<br />")
document.write(Int(-6.93443))
</script>
document.write(Int(-6.13443) & "<br />")
document.write(Int(-6.93443))
</script>
Examples of the above output:
-7
-7
-7
try it"
Complete VBScript Reference