VBScript CSngFunction
Complete VBScript Reference
The CSng function converts an expression to a Single (single-precision) type.
The expression must be a numeric value.
Syntax
CSng(expression)
| Parameters | Description |
|---|---|
| expression | Required. Any valid expression. |
Example
Example
<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>
The above example outputs:
300000
1536.753
-6700000
1536.753
-6700000
Try it »
Complete VBScript Reference Other Extensions