string to double try parse ---decimals lost

  • Thread starter Thread starter Clarkie
  • Start date Start date
C

Clarkie

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?
 
Clarkie said:
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?


Enable Option Strict.


Armin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top