|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| ||||||||||||||||||||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Scientific notation in Visual Basic 2008?
Im writing a steamID to CommunityID conversion program in the Visual Basic 2008 language.
My code is: Code:
If Me.cboSteamOrCommunity.SelectedIndex = 0 Then
Dim ID() As String = Split(txtID.Text, ":")
If CDbl(ID(1)) = 1 Then
Dim intA As Integer = 1.0
Dim dblSteamID As Double
Dim dblID As Integer
Const cdblNumber As Double = 76561197960265728
Dim dbl2 As Integer = 2
Dim strSteamID As Double
Dim intSteamID As Double
dblID = Convert.ToInt32(ID(2))
dblSteamID = (cdblNumber + intA + (dblID * dbl2))
strSteamID = dblSteamID.ToString("F0")
Dim SteamID() As String = Split(CStr(strSteamID), ".")
txtID.Text = CStr(strSteamID)
lblID.Text = dblSteamID
End If
both dblSteamID and strSteamID are both showing in scientific notation. I cannot have this I think there is an issue in the math causing wrong convertions because of the scientific notation but I cannot seem to figure out where it is being changed into scientific notation. Any help on this would be greatly appreciated. |
|
#2
|
|||
|
|||
|
It still does this with Option Strict on and
strSteamID = dblSteamID.ToString("F0") Dim SteamID() As String = Split(CStr(strSteamID), ".") txtID.Text = CStr(strSteamID) Removed to remove bugs with strict on The Text boxe's code for input of STEAMID is Me.txtID.Location = New System.Drawing.Point(106, 154) Me.txtID.Name = "txtID" Me.txtID.Size = New System.Drawing.Size(232, 20) Me.txtID.TabIndex = 8 If anyone can see smething that could be wring with that. |
|
#3
|
|||
|
|||
|
Anyone have any idea?
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Scientific notation in Visual Basic 2008? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|