|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
string to double try parse ---decimals lostHi!
I have a string that I try to convert into a double Dim dblOrgAmount As Integer Dim sLine as string Dim blnSuccess As Boolean blnSuccess = Double.TryParse(sLine.Substring(65, 15), dblOrgAmount) The problem is that dblOrgAmount does not contain any decimals, though the string does. EG -8967676.675 ----> -8967677 I am using "en-US" as culture for the current thread. Any ideas?
Show quote
Hide quote
"Clarkie" <clarkbo***@rock.sendmenot.etmail.com> schrieb Enable Option Strict.> Hi! > > I have a string that I try to convert into a double > > Dim dblOrgAmount As Integer > Dim sLine as string > Dim blnSuccess As Boolean > blnSuccess = Double.TryParse(sLine.Substring(65, 15), dblOrgAmount) > > The problem is that dblOrgAmount does not contain any decimals, > though the string does. > EG > -8967676.675 ----> -8967677 > > I am using "en-US" as culture for the current thread. > > Any ideas? Armin "Clarkie" <clarkbo***@rock.sendmenot.etmail.com> schrieb: => 'Dim dblOrgAmount As Double'-> I have a string that I try to convert into a double > > Dim dblOrgAmount As Integer Show quoteHide quote > Dim sLine as string > Dim blnSuccess As Boolean > blnSuccess = Double.TryParse(sLine.Substring(65, 15), dblOrgAmount) > > The problem is that dblOrgAmount does not contain any decimals, though the > string does. > EG > -8967676.675 ----> -8967677 > > I am using "en-US" as culture for the current thread. -- M S Herfried K. Wagner M V P <URL:http://dotnet.mvps.org/> V B <URL:http://classicvb.org/petition/> What a mistake!
I should get some sleep I guess! Thanks! Clarkie Show quoteHide quote "Herfried K. Wagner [MVP]" <hirf-spam-me-here@gmx.at> wrote in message news:%23rHWLG3JGHA.3912@TK2MSFTNGP10.phx.gbl... > "Clarkie" <clarkbo***@rock.sendmenot.etmail.com> schrieb: >> I have a string that I try to convert into a double >> >> Dim dblOrgAmount As Integer > > => 'Dim dblOrgAmount As Double'- > >> Dim sLine as string >> Dim blnSuccess As Boolean >> blnSuccess = Double.TryParse(sLine.Substring(65, 15), dblOrgAmount) >> >> The problem is that dblOrgAmount does not contain any decimals, though >> the string does. >> EG >> -8967676.675 ----> -8967677 >> >> I am using "en-US" as culture for the current thread. > > -- > M S Herfried K. Wagner > M V P <URL:http://dotnet.mvps.org/> > V B <URL:http://classicvb.org/petition/> |
|||||||||||||||||||||||