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