473,320 Members | 2,052 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,320 software developers and data experts.

How to convert string to float?

i want to covert a querystring to float number in asp.
what function should i use?

i know cint() can convert string to int
but how about float?
Jul 19 '05 #1
4 88874
hi,

usually you can use the round function.
As asp deals with the variant type, something tlike that should work

'querystring : ?id=1&value=10.874
id=request.querystring("id")
v=request.querystring("value")
v=round(v,3)
"Jason Chan" <no@email.com> a écrit dans le message de
news:OZ*************@tk2msftngp13.phx.gbl...
i want to covert a querystring to float number in asp.
what function should i use?

i know cint() can convert string to int
but how about float?

Jul 19 '05 #2
CDbl() or CSng() will do the trick. Use IsNumeric() to make sure it's
numeric first.

Alan

"Jason Chan" <no@email.com> wrote in message
news:OZ*************@tk2msftngp13.phx.gbl...
i want to covert a querystring to float number in asp.
what function should i use?

i know cint() can convert string to int
but how about float?

Jul 19 '05 #3
I got it, thanks~
"Martin CLAVREUIL" <ma**************@wanadoo.fr> ¦b¶l¥ó news:e9**************@TK2MSFTNGP10.phx.gbl ¤¤¼¶¼g...
hi,

usually you can use the round function.
As asp deals with the variant type, something tlike that should work

'querystring : ?id=1&value=10.874
id=request.querystring("id")
v=request.querystring("value")
v=round(v,3)
"Jason Chan" <no@email.com> a écrit dans le message de
news:OZ*************@tk2msftngp13.phx.gbl...
i want to covert a querystring to float number in asp.
what function should i use?

i know cint() can convert string to int
but how about float?


Jul 19 '05 #4
Thanks for answering.
"Alan" <Xa*************@XparadiseX.XnetX.XnzX> ¦b¶l¥ó news:ep**************@tk2msftngp13.phx.gbl ¤¤¼¶¼g...
CDbl() or CSng() will do the trick. Use IsNumeric() to make sure it's
numeric first.

Alan

"Jason Chan" <no@email.com> wrote in message
news:OZ*************@tk2msftngp13.phx.gbl...
i want to covert a querystring to float number in asp.
what function should i use?

i know cint() can convert string to int
but how about float?


Jul 19 '05 #5

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

Similar topics

2
by: Nathan | last post by:
Is there a way to convert a string to a CipherMessage? I am calling a function that decrypts a CipherMessage and returns the value. The only problem is when I want to use an encrypted value stored...
2
by: respect | last post by:
i want to convert real float number to 32-bit IEEE binary format in C++ ? plz help me in finding the codes as fast as u can ] Example for input -6.5, the output should be. 1 10000001...
3
by: Petr Jakes | last post by:
Hi, I am trying to convert string to the "escaped string". example: from "0xf" I need "\0xf" I am able to do it like: a="0xf" escaped_a=("\%s" % a ).decode("string_escape") But it looks a...
3
by: Ursula | last post by:
Is it possible to convert a string in a file. The problem is this: I have an object string that is a file xml and I want to pass to Deserialize function, but Deserialize function expect an object...
3
by: Shawn Ferguson | last post by:
Hello All, I'm trying to do what I would think would be simple and straightforward, but it is not. I have a 2 textbox on a form, a label, and a button, when I click the botton I want to add the...
1
by: tomerd11 | last post by:
please halp me to convert string to float
12
by: Peter | last post by:
Trying to convert string to byte array. the following code returns byte array of {107, 62, 194, 139, 64} how can I convert this string to a byte array of {107, 62, 139, 65} ...
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
7
by: Udara chathuranga | last post by:
How can I convert binary float number into a decimal float number ?
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.