Ask a Question related to ASP, Design and Development.
-
Jason Chan #1
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?
Jason Chan Guest
-
#39126 [NEW]: String->float->String conversion behavior
From: bobson at rpg dot pl Operating system: Linux PHP version: 5CVS-2006-10-11 (snap) PHP Bug Type: Unknown/Other Function... -
Convert float value to integer
l have a simple question ...l want to convert value from float to interger exemple 5.399 convert to 5 or 5.79 convert to 6 -
help float to string
try the sprintf print sprint("%.02f", $f); if I'm not rong; -----Original Message----- From: perl@swanmail.com -
#25562 [Opn->Bgs]: Float to String to Float conversion error
ID: 25562 Updated by: helly@php.net Reported By: daseymour at 3hc dot org -Status: Open +Status: ... -
#25562 [NEW]: Float to String to Float conversion error
From: daseymour at 3hc dot org Operating system: and PHP version: 4.3.3 PHP Bug Type: Math related Bug description: Float... -
Martin CLAVREUIL #2
Re: How to convert string to float?
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:OZlikrpcDHA.856@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?
>
>
Martin CLAVREUIL Guest
-
Alan #3
Re: How to convert string to float?
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:OZlikrpcDHA.856@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?
>
>
Alan Guest
-
Jason Chan #4
Re: How to convert string to float?
I got it, thanks~
"Martin CLAVREUIL" <martin.clavreuil@wanadoo.fr> ¦b¶l¥ó news:e9XhoAqcDHA.1884@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:OZlikrpcDHA.856@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?
> >
> >
>
Jason Chan Guest
-
Jason Chan #5
Re: How to convert string to float?
Thanks for answering.
"Alan" <XalanX.XhowardX@XparadiseX.XnetX.XnzX> ¦b¶l¥ó news:ep0OJhrcDHA.2672@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:OZlikrpcDHA.856@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?
> >
> >
>
Jason Chan Guest



Reply With Quote

