VBScript CSng function
CSng function to convert expressions to single-precision (Single) type.
Expression must be a numeric value.
grammar
CSng(expression)
参数 | 描述 |
---|---|
expression | 必需。任何有效的表达式。 |
Examples
Examples
<script type="text/vbscript">
document.write(CSng("300000") & "<br />")
document.write(CSng(1536.75263541) & "<br />")
document.write(CSng(-6700000) & "<br />")
</script>
document.write(CSng("300000") & "<br />")
document.write(CSng(1536.75263541) & "<br />")
document.write(CSng(-6700000) & "<br />")
</script>
Examples of the above output:
300000
1536.753
-6700000
1536.753
-6700000
try it"
Complete VBScript Reference