473,386 Members | 1,702 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to convert string to double?

Hi,

In .Net, how to convert a string to a double?

Thanks in advance!
Cindy
Jul 21 '05 #1
4 47039

use cdbl function to convert the string

cdbl("123.456") will give you 123.456
Jul 21 '05 #2
System.Double.Parse()

"cindy liu" <ci*******@spam.com> wrote in message
news:24*****************************@phx.gbl...
Hi,

In .Net, how to convert a string to a double?

Thanks in advance!
Cindy

Jul 21 '05 #3
In article <24*****************************@phx.gbl>, ci*******@spam.com
says...
In .Net, how to convert a string to a double?


Convert.ToDouble(string)

Converts the specified String representation of a number to an
equivalent double-precision floating point number.

[Visual Basic]
Overloads Public Shared Function ToDouble( _
ByVal value As String _
) As Double

[C#]
public static double ToDouble(
string value
);

[C++]
public: static double ToDouble(
String* value
);

[JScript]
public static function ToDouble(
value : String
) : double;

Parameters
value
A String containing a number to convert.

Return Value
A double-precision floating point number equivalent to the value of
value.

--
Who's better for furniture? NOOOOOOOOOOOOOOOOOOBODY!!!!

Guinness Mann
GM***@Dublin.com

Jul 21 '05 #4
Try using the system.Convert.ToDouble() function
-----Original Message-----
Hi,

In .Net, how to convert a string to a double?

Thanks in advance!
Cindy
.

Jul 21 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Norvin Laudon | last post by:
Hi, Can somebody explain the following, from the MSDN documentation for the "System.Convert.ToInt32(double)" function <quote> Return Value value rounded to the nearest 32-bit signed...
17
by: David Scemama | last post by:
Hi, I'm writing a program using VB.NET that needs to communicate with a DOS Pascal program than cannot be modified. The communication channel is through some file databases, and I have a huge...
4
by: cindy liu | last post by:
Hi, In .Net, how to convert a string to a double? Thanks in advance! Cindy
1
by: joe | last post by:
how to convert string to money before to insert to sql serve(sql db)
6
by: Doug | last post by:
Hi I have a short piece of trial code that compares some input and then produces a message based on the value. However I get a build error that i dont know how to resolve ' Cannot implicitly...
15
by: shiniskumar | last post by:
How to convert string to double? Ive got a double variable dTot; its value is 5.037717235E7 when i did FreemarkerTools.formatDecimal(dTot) i got it as string "50377172.35". now i want to...
5
oll3i
by: oll3i | last post by:
public class Cennik { private static Cennik instance = null; Map<String,Double> cennik = new HashMap<String,Double> (); private Cennik() { // prywatny konstruktor } public...
9
by: engteng | last post by:
How do I convert string to numeric in VB.NET 2003 ? Example convert P50001 to 50001 or 50001P to 50001 but if P is in middle then not convert. Regards, Tee
1
by: chaitukdr | last post by:
Hi, I tried to convert string value 1.10 to double like double val=convert.todouble("1.10"); only 1.1 is given as result instead of 1.10 plz suggest me with a proper answer
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.