PC Review


Reply
Thread Tools Rate Thread

convert a string to a double

 
 
=?Utf-8?B?U3JNb3Vzc2U=?=
Guest
Posts: n/a
 
      7th Jul 2005
I am trying to convert a string absolutely contains a number at all times to
a double for use of comparison and numerical calculation, VBA doesn't seem to
support the System.Convert.ToDouble() method... I have searched and searched
and can't find a way to do this... any help would be VERY appreciated!

For a little extra info (for anyone who wants to know) the number stored in
the text field is a four digit number with no decimal or anything else fancy
like that. I would not hesitate converting it to a different number if it
were easier.

 
Reply With Quote
 
 
 
 
=?Utf-8?B?U3JNb3Vzc2U=?=
Guest
Posts: n/a
 
      7th Jul 2005
Apparently I can manipulate the string as a number directly... hmm... that is
interesting, but is it safe?
 
Reply With Quote
 
=?Utf-8?B?S2xhdHV1?=
Guest
Posts: n/a
 
      7th Jul 2005
Use the Cdbl() function

"SrMousse" wrote:

> Apparently I can manipulate the string as a number directly... hmm... that is
> interesting, but is it safe?

 
Reply With Quote
 
Dirk Goldgar
Guest
Posts: n/a
 
      7th Jul 2005
"SrMousse" <(E-Mail Removed)> wrote in message
news:5F00F4D3-D0FB-44A7-8D3B-(E-Mail Removed)
> Apparently I can manipulate the string as a number directly... hmm...
> that is interesting, but is it safe?


Probably you're seeing the effect of an implicit conversion to one of
the number types. You can use either the CDbl() function or the Val()
function to explicitly convert your string to a Double.

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert from String to Double Peter Newman Microsoft VB .NET 2 17th Apr 2009 04:46 PM
convert double to string Denis Microsoft C# .NET 2 28th Apr 2008 10:26 AM
double string convert Nicolai.Schoenberg@googlemail.com Microsoft C# .NET 2 6th Jul 2007 10:05 AM
Convert from double to string Marty Microsoft Dot NET 6 3rd Sep 2004 01:42 PM
how to convert string to double? cindy liu Microsoft Dot NET 4 7th Oct 2003 09:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:16 AM.