CSng - Built-in Conversion Function¶
Purpose¶
CSng returns an expression converted to a single precision point.
Syntax¶
CSng(exp)
| Argument | Required | Description |
|---|---|---|
exp |
Yes | Any valid expression |
Returns¶
Number (single precision = 32 bits)
Example¶
Dim nDouble
Let nDouble = 75.342111568945835
Return CSng(nDouble) // returns 75.34211 if the field is formatted with 5 decimals in the field properties
Notes¶
- CSng uses the locale settings to convert
expto a single. - When
expcannot be converted to a numeric value, a runtime error is generated. - The range is: ±1.18×10-38 to ±3.4×1038
- Precision is approximately 7 decimal digits.