473,772 Members | 2,388 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 3191

"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
11959
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
11662
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 the following pseudocode: myVarchar = MagicFunction(123.0003);
8
4475
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? Thanks, Scott
7
2710
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
35980
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 haywire. So my question is, given this code: int main() { float f = 59.89F;
10
1997
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
4028
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 generates an error after a few iterations because buffer1 is
25
4394
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 that has several datagrids in it.
3
2501
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
9621
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9454
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 synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10106
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10039
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
8937
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7461
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 instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4009
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2851
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.