Bookshelf Home | Contents | Index | PDF |
Siebel VB Language Reference > VB Language Reference > CSng FunctionThis standard VB function converts an expression to the data type single. SyntaxReturnsThe value of expression as a single-precision floating-point number. UsageThe expression must have a value within the range allowed for the single data type, or an error occurs. Strings that cannot be converted to an integer result in a Type Mismatch error. Variants containing null result in an Illegal Use of Null error. ExampleThis example calculates the factorial of a number. A factorial (notated with an exclamation mark, !) is the product of a number and each integer between it and the number 1. For example, 5 factorial, or 5!, is the product of 5*4*3*2*1, or the value 120. Sub Button_Click factorial = 1 See AlsoCCur Function |
Siebel VB Language Reference |