Siebel VB Language Reference > Methods Reference for Siebel VB > Conversion Methods >

Convert Expression to Long Method


The Convert Expression to Long method converts the value that the expression argument contains to a long number. It returns this number. Note the following:

  • After rounding, the result must reside in the range of negative 32767 to 32767. If it is not, then an error occurs.
  • A string that cannot convert to a long number causes a Type Mismatch error.
  • A variant that contains a null result causes an Illegal Use of Null error.

For more information, see Numeric Data Types That Siebel VB Uses.

Format

CLng(expression)

For information about the arguments that you can use with this method, see Argument That You Can Use with Conversion Methods.

Example

The following example divides the national debt of the United States by the number of people who live in this country to find the amount of money each person must pay to retire this debt. It converts this number to a long integer, and then formats it as currency:

Sub Button_Click
   Dim debt As Single
   Dim msgtext
   Const Populace = 311000000
   debt = 14000000000000
   msgtext = "The $/citizen is: " & _
      Format(CLng(Debt/ Populace), "Currency")
End Sub

Siebel VB Language Reference Copyright © 2015, Oracle and/or its affiliates. All rights reserved. Legal Notices.