473,545 Members | 2,012 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Converting text to double

Hi,

I have a problem converting text to a double. Why doesn't the code work:
If Not (txtdocbedrag.T ext = "") Then

Select Case ddlBedrag.Selec tedIndex

Case 0

Case 1

whereSQL += "cast(bedra g as numeric(10,2)) > '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 2

whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 3

whereSQL += "cast(bedra g as numeric(10,2)) < '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 4

whereSQL += "cast(bedra g as numeric(10,2)) <= '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 5

whereSQL += "cast(bedra g as numeric(10,2)) = '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 6

whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
Double.Parse(tx tdocbedrag.Text ) & "' cast(bedrag as numeric(10,2)) < '" &
Double.Parse(tx tBedragTot.Text ) & "' and "

End Select

End If
Apr 18 '06 #1
12 3135

"Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Hi,

I have a problem converting text to a double. Why doesn't the code work:
If Not (txtdocbedrag.T ext = "") Then

Select Case ddlBedrag.Selec tedIndex

Case 0

Case 1

whereSQL += "cast(bedra g as numeric(10,2)) > '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 2

whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 3

whereSQL += "cast(bedra g as numeric(10,2)) < '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 4

whereSQL += "cast(bedra g as numeric(10,2)) <= '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 5

whereSQL += "cast(bedra g as numeric(10,2)) = '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 6

whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
Double.Parse(tx tdocbedrag.Text ) & "' cast(bedrag as numeric(10,2)) < '" &
Double.Parse(tx tBedragTot.Text ) & "' and "

End Select

End If

One thing I spotted is the use of single quote punctuation around a numeric
value (the result of Double.Parse(.. .).
In your SQL query (that is what you're building, correct?), numeric values
should have no punctuation characters surrounding them. String values need
single quotes, as to dates (in SQL Server. Access date punctuation is the
#.).

--
Peter [MVP Visual Developer]
Jack of all trades, master of none.
Apr 18 '06 #2
I dont know but converting a string to a double does work:
Dim st As String = "2.0"
Dim d As Double
d = Double.Parse(st )
"Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Hi,

I have a problem converting text to a double. Why doesn't the code work:
If Not (txtdocbedrag.T ext = "") Then

Select Case ddlBedrag.Selec tedIndex

Case 0

Case 1

whereSQL += "cast(bedra g as numeric(10,2)) > '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 2

whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 3

whereSQL += "cast(bedra g as numeric(10,2)) < '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 4

whereSQL += "cast(bedra g as numeric(10,2)) <= '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 5

whereSQL += "cast(bedra g as numeric(10,2)) = '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 6

whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
Double.Parse(tx tdocbedrag.Text ) & "' cast(bedrag as numeric(10,2)) < '" &
Double.Parse(tx tBedragTot.Text ) & "' and "

End Select

End If

Apr 18 '06 #3
but the problem is the "cast(bedra g as numeric(10,2)"
bedrag=database field
"Pipo" <Pa****@Mayo.co m> wrote in message
news:OR******** ******@TK2MSFTN GP02.phx.gbl...
I dont know but converting a string to a double does work:
Dim st As String = "2.0"
Dim d As Double
d = Double.Parse(st )
"Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Hi,

I have a problem converting text to a double. Why doesn't the code work:
If Not (txtdocbedrag.T ext = "") Then

Select Case ddlBedrag.Selec tedIndex

Case 0

Case 1

whereSQL += "cast(bedra g as numeric(10,2)) > '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 2

whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 3

whereSQL += "cast(bedra g as numeric(10,2)) < '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 4

whereSQL += "cast(bedra g as numeric(10,2)) <= '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 5

whereSQL += "cast(bedra g as numeric(10,2)) = '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 6

whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
Double.Parse(tx tdocbedrag.Text ) & "' cast(bedrag as numeric(10,2)) < '" &
Double.Parse(tx tBedragTot.Text ) & "' and "

End Select

End If


Apr 18 '06 #4
Define "doesn't work". Are you getting an error?

And what kind of syntax is "bedrag=databas efield".

apples=oranges

May I suggest you use some sort of meaningful naming convention?

Jeff

"Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in message
news:up******** ******@TK2MSFTN GP05.phx.gbl...
but the problem is the "cast(bedra g as numeric(10,2)"
bedrag=database field
"Pipo" <Pa****@Mayo.co m> wrote in message
news:OR******** ******@TK2MSFTN GP02.phx.gbl...
I dont know but converting a string to a double does work:
Dim st As String = "2.0"
Dim d As Double
d = Double.Parse(st )
"Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Hi,

I have a problem converting text to a double. Why doesn't the code work:
If Not (txtdocbedrag.T ext = "") Then

Select Case ddlBedrag.Selec tedIndex

Case 0

Case 1

whereSQL += "cast(bedra g as numeric(10,2)) > '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 2

whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 3

whereSQL += "cast(bedra g as numeric(10,2)) < '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 4

whereSQL += "cast(bedra g as numeric(10,2)) <= '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 5

whereSQL += "cast(bedra g as numeric(10,2)) = '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 6

whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
Double.Parse(tx tdocbedrag.Text ) & "' cast(bedrag as numeric(10,2)) < '"
& Double.Parse(tx tBedragTot.Text ) & "' and "

End Select

End If



Apr 18 '06 #5
bedrag = databasefield is not a syntax it was just saying that it is a field
from the database, it's not in the code.
The eroor i get is: Error converting data type varchar to numeric

"Jeff Dillon" <je********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Define "doesn't work". Are you getting an error?

And what kind of syntax is "bedrag=databas efield".

apples=oranges

May I suggest you use some sort of meaningful naming convention?

Jeff

"Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in message
news:up******** ******@TK2MSFTN GP05.phx.gbl...
but the problem is the "cast(bedra g as numeric(10,2)"
bedrag=database field
"Pipo" <Pa****@Mayo.co m> wrote in message
news:OR******** ******@TK2MSFTN GP02.phx.gbl...
I dont know but converting a string to a double does work:
Dim st As String = "2.0"
Dim d As Double
d = Double.Parse(st )
"Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in
message news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Hi,

I have a problem converting text to a double. Why doesn't the code
work:
If Not (txtdocbedrag.T ext = "") Then

Select Case ddlBedrag.Selec tedIndex

Case 0

Case 1

whereSQL += "cast(bedra g as numeric(10,2)) > '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 2

whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 3

whereSQL += "cast(bedra g as numeric(10,2)) < '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 4

whereSQL += "cast(bedra g as numeric(10,2)) <= '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 5

whereSQL += "cast(bedra g as numeric(10,2)) = '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "

Case 6

whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
Double.Parse(tx tdocbedrag.Text ) & "' cast(bedrag as numeric(10,2)) < '"
& Double.Parse(tx tBedragTot.Text ) & "' and "

End Select

End If



Apr 19 '06 #6
What is the value of bedrag then?
Are you trying to convert text to a double?
Double.Parse("S omeText") wont work ofcourse.

"Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
bedrag = databasefield is not a syntax it was just saying that it is a
field from the database, it's not in the code.
The eroor i get is: Error converting data type varchar to numeric

"Jeff Dillon" <je********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Define "doesn't work". Are you getting an error?

And what kind of syntax is "bedrag=databas efield".

apples=oranges

May I suggest you use some sort of meaningful naming convention?

Jeff

"Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in message
news:up******** ******@TK2MSFTN GP05.phx.gbl...
but the problem is the "cast(bedra g as numeric(10,2)"
bedrag=database field
"Pipo" <Pa****@Mayo.co m> wrote in message
news:OR******** ******@TK2MSFTN GP02.phx.gbl...
I dont know but converting a string to a double does work:
Dim st As String = "2.0"
Dim d As Double
d = Double.Parse(st )
"Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in
message news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
> Hi,
>
> I have a problem converting text to a double. Why doesn't the code
> work:
> If Not (txtdocbedrag.T ext = "") Then
>
> Select Case ddlBedrag.Selec tedIndex
>
> Case 0
>
> Case 1
>
> whereSQL += "cast(bedra g as numeric(10,2)) > '" &
> Double.Parse(tx tdocbedrag.Text ) & "' and "
>
> Case 2
>
> whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
> Double.Parse(tx tdocbedrag.Text ) & "' and "
>
> Case 3
>
> whereSQL += "cast(bedra g as numeric(10,2)) < '" &
> Double.Parse(tx tdocbedrag.Text ) & "' and "
>
> Case 4
>
> whereSQL += "cast(bedra g as numeric(10,2)) <= '" &
> Double.Parse(tx tdocbedrag.Text ) & "' and "
>
> Case 5
>
> whereSQL += "cast(bedra g as numeric(10,2)) = '" &
> Double.Parse(tx tdocbedrag.Text ) & "' and "
>
> Case 6
>
> whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
> Double.Parse(tx tdocbedrag.Text ) & "' cast(bedrag as numeric(10,2)) <
> '" & Double.Parse(tx tBedragTot.Text ) & "' and "
>
> End Select
>
> End If
>
>



Apr 19 '06 #7
bedrag is varchar in the database. I have to compare the varchar out of the
database with a value in a textbox, so i convert the varchar to double and i
parse the textbox value to double.
"Pipo" <Pa****@Mayo.co m> wrote in message
news:eS******** ******@TK2MSFTN GP05.phx.gbl...
What is the value of bedrag then?
Are you trying to convert text to a double?
Double.Parse("S omeText") wont work ofcourse.

"Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
bedrag = databasefield is not a syntax it was just saying that it is a
field from the database, it's not in the code.
The eroor i get is: Error converting data type varchar to numeric

"Jeff Dillon" <je********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Define "doesn't work". Are you getting an error?

And what kind of syntax is "bedrag=databas efield".

apples=oranges

May I suggest you use some sort of meaningful naming convention?

Jeff

"Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in
message news:up******** ******@TK2MSFTN GP05.phx.gbl...
but the problem is the "cast(bedra g as numeric(10,2)"
bedrag=database field
"Pipo" <Pa****@Mayo.co m> wrote in message
news:OR******** ******@TK2MSFTN GP02.phx.gbl...
>I dont know but converting a string to a double does work:
> Dim st As String = "2.0"
> Dim d As Double
> d = Double.Parse(st )
>
>
> "Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in
> message news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
>> Hi,
>>
>> I have a problem converting text to a double. Why doesn't the code
>> work:
>> If Not (txtdocbedrag.T ext = "") Then
>>
>> Select Case ddlBedrag.Selec tedIndex
>>
>> Case 0
>>
>> Case 1
>>
>> whereSQL += "cast(bedra g as numeric(10,2)) > '" &
>> Double.Parse(tx tdocbedrag.Text ) & "' and "
>>
>> Case 2
>>
>> whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
>> Double.Parse(tx tdocbedrag.Text ) & "' and "
>>
>> Case 3
>>
>> whereSQL += "cast(bedra g as numeric(10,2)) < '" &
>> Double.Parse(tx tdocbedrag.Text ) & "' and "
>>
>> Case 4
>>
>> whereSQL += "cast(bedra g as numeric(10,2)) <= '" &
>> Double.Parse(tx tdocbedrag.Text ) & "' and "
>>
>> Case 5
>>
>> whereSQL += "cast(bedra g as numeric(10,2)) = '" &
>> Double.Parse(tx tdocbedrag.Text ) & "' and "
>>
>> Case 6
>>
>> whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
>> Double.Parse(tx tdocbedrag.Text ) & "' cast(bedrag as numeric(10,2)) <
>> '" & Double.Parse(tx tBedragTot.Text ) & "' and "
>>
>> End Select
>>
>> End If
>>
>>
>
>



Apr 19 '06 #8
Post the exact line, and the value of all variables, that is generating the
error. You can use CDbl too

Jeff
"Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in message
news:ub******** ******@TK2MSFTN GP05.phx.gbl...
bedrag is varchar in the database. I have to compare the varchar out of
the database with a value in a textbox, so i convert the varchar to double
and i parse the textbox value to double.
"Pipo" <Pa****@Mayo.co m> wrote in message
news:eS******** ******@TK2MSFTN GP05.phx.gbl...
What is the value of bedrag then?
Are you trying to convert text to a double?
Double.Parse("S omeText") wont work ofcourse.

"Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in message
news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
bedrag = databasefield is not a syntax it was just saying that it is a
field from the database, it's not in the code.
The eroor i get is: Error converting data type varchar to numeric

"Jeff Dillon" <je********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
Define "doesn't work". Are you getting an error?

And what kind of syntax is "bedrag=databas efield".

apples=oranges

May I suggest you use some sort of meaningful naming convention?

Jeff

"Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in
message news:up******** ******@TK2MSFTN GP05.phx.gbl...
> but the problem is the "cast(bedra g as numeric(10,2)"
> bedrag=database field
> "Pipo" <Pa****@Mayo.co m> wrote in message
> news:OR******** ******@TK2MSFTN GP02.phx.gbl...
>>I dont know but converting a string to a double does work:
>> Dim st As String = "2.0"
>> Dim d As Double
>> d = Double.Parse(st )
>>
>>
>> "Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in
>> message news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
>>> Hi,
>>>
>>> I have a problem converting text to a double. Why doesn't the code
>>> work:
>>> If Not (txtdocbedrag.T ext = "") Then
>>>
>>> Select Case ddlBedrag.Selec tedIndex
>>>
>>> Case 0
>>>
>>> Case 1
>>>
>>> whereSQL += "cast(bedra g as numeric(10,2)) > '" &
>>> Double.Parse(tx tdocbedrag.Text ) & "' and "
>>>
>>> Case 2
>>>
>>> whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
>>> Double.Parse(tx tdocbedrag.Text ) & "' and "
>>>
>>> Case 3
>>>
>>> whereSQL += "cast(bedra g as numeric(10,2)) < '" &
>>> Double.Parse(tx tdocbedrag.Text ) & "' and "
>>>
>>> Case 4
>>>
>>> whereSQL += "cast(bedra g as numeric(10,2)) <= '" &
>>> Double.Parse(tx tdocbedrag.Text ) & "' and "
>>>
>>> Case 5
>>>
>>> whereSQL += "cast(bedra g as numeric(10,2)) = '" &
>>> Double.Parse(tx tdocbedrag.Text ) & "' and "
>>>
>>> Case 6
>>>
>>> whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
>>> Double.Parse(tx tdocbedrag.Text ) & "' cast(bedrag as numeric(10,2)) <
>>> '" & Double.Parse(tx tBedragTot.Text ) & "' and "
>>>
>>> End Select
>>>
>>> End If
>>>
>>>
>>
>>
>
>



Apr 19 '06 #9
whereSQL += "cast(bedra g as numeric(10,2)) > '" &
Double.Parse(tx tdocbedrag.Text ) & "' and "
Bedrag = varchar with a

"Jeff Dillon" <je********@hot mail.com> wrote in message
news:OW******** ******@TK2MSFTN GP03.phx.gbl... Post the exact line, and the value of all variables, that is generating
the error. You can use CDbl too

Jeff
"Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in message
news:ub******** ******@TK2MSFTN GP05.phx.gbl...
bedrag is varchar in the database. I have to compare the varchar out of
the database with a value in a textbox, so i convert the varchar to
double and i parse the textbox value to double.
"Pipo" <Pa****@Mayo.co m> wrote in message
news:eS******** ******@TK2MSFTN GP05.phx.gbl...
What is the value of bedrag then?
Are you trying to convert text to a double?
Double.Parse("S omeText") wont work ofcourse.

"Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in
message news:%2******** ********@TK2MSF TNGP05.phx.gbl. ..
bedrag = databasefield is not a syntax it was just saying that it is a
field from the database, it's not in the code.
The eroor i get is: Error converting data type varchar to numeric

"Jeff Dillon" <je********@hot mail.com> wrote in message
news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
> Define "doesn't work". Are you getting an error?
>
> And what kind of syntax is "bedrag=databas efield".
>
> apples=oranges
>
> May I suggest you use some sort of meaningful naming convention?
>
> Jeff
>
> "Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in
> message news:up******** ******@TK2MSFTN GP05.phx.gbl...
>> but the problem is the "cast(bedra g as numeric(10,2)"
>> bedrag=database field
>> "Pipo" <Pa****@Mayo.co m> wrote in message
>> news:OR******** ******@TK2MSFTN GP02.phx.gbl...
>>>I dont know but converting a string to a double does work:
>>> Dim st As String = "2.0"
>>> Dim d As Double
>>> d = Double.Parse(st )
>>>
>>>
>>> "Frederik Vanderhaeghe" <fr************ ******@gmail.co m> wrote in
>>> message news:%2******** ********@TK2MSF TNGP02.phx.gbl. ..
>>>> Hi,
>>>>
>>>> I have a problem converting text to a double. Why doesn't the code
>>>> work:
>>>> If Not (txtdocbedrag.T ext = "") Then
>>>>
>>>> Select Case ddlBedrag.Selec tedIndex
>>>>
>>>> Case 0
>>>>
>>>> Case 1
>>>>
>>>> whereSQL += "cast(bedra g as numeric(10,2)) > '" &
>>>> Double.Parse(tx tdocbedrag.Text ) & "' and "
>>>>
>>>> Case 2
>>>>
>>>> whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
>>>> Double.Parse(tx tdocbedrag.Text ) & "' and "
>>>>
>>>> Case 3
>>>>
>>>> whereSQL += "cast(bedra g as numeric(10,2)) < '" &
>>>> Double.Parse(tx tdocbedrag.Text ) & "' and "
>>>>
>>>> Case 4
>>>>
>>>> whereSQL += "cast(bedra g as numeric(10,2)) <= '" &
>>>> Double.Parse(tx tdocbedrag.Text ) & "' and "
>>>>
>>>> Case 5
>>>>
>>>> whereSQL += "cast(bedra g as numeric(10,2)) = '" &
>>>> Double.Parse(tx tdocbedrag.Text ) & "' and "
>>>>
>>>> Case 6
>>>>
>>>> whereSQL += "cast(bedra g as numeric(10,2)) >= '" &
>>>> Double.Parse(tx tdocbedrag.Text ) & "' cast(bedrag as numeric(10,2))
>>>> < '" & Double.Parse(tx tBedragTot.Text ) & "' and "
>>>>
>>>> End Select
>>>>
>>>> End If
>>>>
>>>>
>>>
>>>
>>
>>
>
>




Apr 20 '06 #10

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

Similar topics

5
11948
by: shang | last post by:
Hi! I am trying to find a function that converts a string into a double or a long double number. I found atod() but I don't know which library I have to include to use it. Could someone help me? Thanks!
1
11626
by: Kent Lewandowski | last post by:
Hi, I saw this post from 3 years ago regarding converting DOUBLE values to CHAR in ibm DB2. Now I'm having the same problem. No real solution was posted to that old thread. Has anyone got more information how I avoid the scientific notation when I use the CHAR() function to convert a DOUBLE or FLOAT ? What I want is "MagicFunction" in...
8
4464
by: Scott | last post by:
How do I convert the contents of a textbox to a double for mathmateical operations? I'm using a form to collect values and when the user clicks OK, the vlaues are used for calcualtions... but they need to be double data type. Then, after the calculations, how to do I convert the double back into the data type needed by the textbox control? ...
7
2682
by: Tor Aadnevik | last post by:
Hi, I have a problem converting values from Single to double. eg. When the Single value 12.19 is converted to double, the result is 12.1899995803833. Anyone know how to avoid this? Regards Totto
116
35709
by: Dilip | last post by:
Recently in our code, I ran into a situation where were stuffing a float inside a double. The precision was extended automatically because of that. To make a long story short, this caused problems elsewhere in another part of the system where that figure was used for some calculation and some eventual truncation led to the system going...
10
1964
by: Ron | last post by:
I want to calculate the surface area of a sphere from an inputed radius with option strict on. I guess I am not converting something correctly. Here is what I am doing: I have a textbox txtradius that I enter a radius into. I then have a lable that I want the surface area to be displayed in called lblsurface
3
4006
by: RG | last post by:
I am reading in from a serial port a 16 bit number from 0 to 65536. It is being read as a string from my microcontroller into VB using DEC5 or 5 digits are displayed. I need to display this value live as a decimal number so I can manipulate the value. For instance I have the following line: TextBox2.Text = buffer1 - 32768 but this...
25
4357
by: Blasting Cap | last post by:
I keep getting errors that pop up when I am trying to convert an application from dotnet framework 1.1 to framework 2.0. The old project was saved in sourcesafe from Visual Studio 2003, and I have opened it in Visual Studio 2005. I've cleared up most errors, but have one that beats the heck out of me. I have a page: sales/Item.aspx...
3
2492
by: sparks | last post by:
After changing all the variables in a table from long to double. you get 9.1====becomes==== 9.19999980926514 ok I checked microsoft and they had a workaround. export the values to excel...then import them back into the new table. well I tried that and get the same thing. is there a work around for the work around LOL
0
7406
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7660
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7431
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7761
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5976
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5337
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4949
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1020
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.