Convert from String to Double

P

Peter Newman

Previously posted in the wrong group

I writing an app to read a text file and need to convert a string into a
double.

ie "00000001234" into 12.34

It is part of a translator code the line in question =

Double.Parse(Right("00000000000" & Mid(ImportLine, 38, 11),
11)), _

where Mid(ImportLine, 38, 11) = "00000001234"
 
A

Andrew Morton

Peter said:
I writing an app to read a text file and need to convert a string
into a double.

ie "00000001234" into 12.34

It is part of a translator code the line in question =

Double.Parse(Right("00000000000" & Mid(ImportLine, 38,
11), 11)), _

where Mid(ImportLine, 38, 11) = "00000001234"

Double.Parse(Mid(ImportLine, 38, 11))*0.01

Or is there something you're not telling us about the string?

Andrew
 
C

Cor Ligthert[MVP]

Peter,

In my idea does this work in every version of VB later then version 3

\\\
Dim x As Double = CDbl("00000001234") * 0.01
///

This is complete correct Visual Basic and does not need any Net part even in
language version 9 (or in future 10)

Cor
 

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

Top