Convert.ToInt32 (Single) converts single-precision floating-point number to 32-bit signed integer. : Convert to Int32 « Development « VB.Net

Home
VB.Net
1.2D
2.Application
3.Class
4.Data Structure
5.Data Types
6.Database ADO.net
7.Date Time
8.Development
9.Event
10.File Directory
11.Generics
12.GUI
13.Internationalization I18N
14.Language Basics
15.LINQ
16.Network Remote
17.Reflection
18.Security
19.Thread
20.Windows Presentation Foundation
21.Windows System
22.XML
23.XML LINQ
VB.Net » Development » Convert to Int32Screenshots 
Convert.ToInt32 (Single) converts single-precision floating-point number to 32-bit signed integer.
  

Module Example
   Public Sub Main()

        Dim values() As Single = Single.MinValue, 09.113e-16, Single.MaxValue }
        Dim result As Integer
        
        For Each value As Single In values
           Try
              result = Convert.ToInt32(value)
              Console.WriteLineresult)
           Catch As OverflowException
              Console.WriteLine("{0} is outside the range of the Int32 type.", value)
           End Try   
        Next                                 
   End Sub
End Module

   
    
  
Related examples in the same category
1.Convert.ToInt32 (Boolean) converts Boolean value to 32-bit signed integer.
2.Convert.ToInt32 (Byte) converts 8-bit unsigned integer to 32-bit signed integer.
3.Convert.ToInt32 (Char) converts Unicode character to 32-bit signed integer.
4.Convert.ToInt32 (Decimal) converts decimal number to 32-bit signed integer.
5.Convert.ToInt32 (Double) converts double number to 32-bit signed integer.
6.Convert.ToInt32 (Int16) converts 16-bit signed integer to 32-bit signed integer.
7.Convert.ToInt32 (Int64) converts 64-bit signed integer to 32-bit signed integer.
8.Convert.ToInt32 (Object) converts the value of the specified object to a 32-bit signed integer.
9.Convert.ToInt32 (SByte) converts 8-bit signed integer to 32-bit signed integer.
10.Convert.ToInt32 (String) converts string to an equivalent 32-bit signed integer.
11.Convert.ToInt32 (String, IFormatProvider) converts string to 32-bit signed integer using culture-specific format
12.Convert.ToInt32 (String, Int32) converts string in a base to 32-bit signed integer.
13.Convert.ToInt32 (UInt16) converts 16-bit unsigned integer to 32-bit signed integer.
14.Convert.ToInt32 (UInt32) converts 32-bit unsigned integer to 32-bit signed integer.
15.Convert.ToInt32 (UInt64) converts 64-bit unsigned integer to an equivalent 32-bit signed integer.
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.