NumberFormat() is probably your best bet.

> -----Original Message-----
> From: Robert Orlini [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, October 16, 2002 9:27 AM
> To: CF-Talk
> Subject: RE: percentage of hits
> 
> 
> Thanks Everett. I got it running. One more question...anyway 
> to just display 3.06% and not all extra numbers?
> 
> Robert O.
> 
> -----Original Message-----
> From: Everett, Al [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, October 15, 2002 4:13 PM
> To: CF-Talk
> Subject: RE: percentage of hits
> 
> 
> <cfset percentOfVisits=visits / total_visits * 100>
> 
> 490 is 3.0625% of 16,000
> 
> > -----Original Message-----
> > From: Robert Orlini [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, October 15, 2002 3:59 PM
> > To: CF-Talk
> > Subject: percentage of hits
> > 
> > 
> > Using SUM (I think) how can I get a percentage when comparing 
> > it to a total? For example if #visits# is 490 and 
> > #total_visits# is 16000. What is the code to extract the 
> > percentage of 490 out of 16000?
> > 
> > Below is part of my code:
> > 
> > <cfquery name="getsomedata" datasource="log_stats">
> > select url, count(url) as 'visits' from log_data
> > group by url
> > order by visits desc
> > </cfquery> 
> > 
> > <cfquery name="datacount" datasource="log_stats">
> > Select Count(*) AS total_count FROM log_data
> > </cfquery>
> > 
> > <cfoutput query="datacount">#total_count#</cfoutput>
> > 
> > Thanks.
> > 
> > Robert Orlini
> > HWW
> > 
> > 
> > 
> 
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm


Reply via email to