Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

19.0 instead of 19

Status
Not open for further replies.

aarontra

Programmer
Oct 2, 2002
50
US
In the loop below

<CFLOOP QUERY=myquery>
<A HREF=&quot;mypage.cfm?myvar=#myvar#&qvar=#myquery.ID#&quot;>edit occurence</A>

</cfloop>

the variable myvar is not part of the query.

CF makes the value of 19 into 19.0
?myvar=19.0&qvar=2

Other links on the page use
?myvar=#myvar# without evaluating #myvar# to 19.0

How do I make it stay without the <myvar>.0 on the end of it?

because it later breaks this page when I return the user back to the form.
If I change the querystring to ?myvar=19 it is fine again.

Thank you
Aaron

 
Ok I sort of fixed it with
<cfset myvar = Replace(myvar,&quot;.0&quot;, &quot;&quot;)>
still would like to know how to not have it but the value with .0 on the end in the first place.

I am using MS Access which could be important.

Aaron
 
there is the NumberFormat function to fix it...
NumberFormat(number,mask)

just use it that way
#NumberFormat(myvar,&quot;99999&quot;)#
this will not display the decimal part of any number
 
Thank you

although

myvar = int(myvar)
seems to work better for my app. (I was looking for a number in a list of numbers.)

since #NumberFormat(myvar,&quot;99999&quot;)#
pads the number with spaces
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top