Skip to content
Home ยป VB 6 – Int() Function

VB 6 – Int() Function

    In this article, you will learn about a Int() function.The int() function will change any double or real number into integer and drop the real part.

    For example,

    234.56 becomes 234

    Example Program: Int() Function

    Private Sub Command1_Click()
    
    Dim Num As Double, Result As Double
    
    Num = Val(Text1.Text)
    
    Result = Int(Num)
    
    Text2.Text = Str(Result)
    
    
    End Sub
    
    Private Sub Command2_Click()
    
      Text1.Text = ""
      Text2.Text = ""
      
    End Sub

    Output: Int() Function

    Output - Int Function
    Output – Int Function