String to DateTime

A

Armin Zingler

Cor Ligthert said:
It is one of your statements, however I got no reaction on using the
VAL for this.
(I never used it however I saw it once)

I'm not sure if I understand you...
Val always expects the English format, and, as "nobody" says, the format
will be defined later by the user, so Val is not always usable.
 
A

Armin Zingler

nobody said:
You are restating what I've already said. In my previous post, I
said:

Is there any way, given MyString ("$$53.95") and MyFormat ("$$0.00"),
to convert MyString back into a Decimal? There is no
Decimal.ParseExact(...).

Yes, there's nothing else I can do but repeat it. You can believe it or not:
It is not there! I belive that you need it, really, but it's not there.
Sorry, I didn't design the Framework.
I already know there isn't a ParseExact(...) method for Decimal.
My question was: Is there any way, given MyString (such as "$$53.95")
and MyFormat (such as "$$0.00") to convert MyString back into
Decimal?

I don't know a way, otherwise I would have mentioned it.

--
Armin

How to quote and why:
http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html
 
C

Cor Ligthert

Hi Armin,

I did this,

Dim a As Double = Val(Replace("$49.95", "$", ""))
Dim b As Double = Val(Replace("12.5%", "%", ""))

Strange is that it gives back

49.95 and 12.5 where it should give something else in my opinion for us.

Cor
 
A

Armin Zingler

Cor Ligthert said:
Hi Armin,

I did this,

Dim a As Double = Val(Replace("$49.95", "$", ""))
Dim b As Double = Val(Replace("12.5%", "%", ""))

Strange is that it gives back

49.95 and 12.5 where it should give something else in my opinion for
us.

Why strange? That's what I expect.
 

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

Similar Threads


Top