Looks like it was in the code that the user put in the top.
#Responses#, while showing in CFOUTPUT as being correct, was really
converted somehow to an invalid object. Reason is that the user did the
following:
========
<CFQUERY datasource="#appdsn#" name="SurveyTotal">
SELECT Count(*) AS TotalRecords
FROM GeneralSurvey
</CFQUERY>
<CFOUTPUT>
<CFSET Responses = #NumberFormat(SurveyTotal.TotalRecords)#>
</CFOUTPUT>
========
The "NumberFormat" screws with the Responses var, and makes it show
properly, but will not calculate properly.
After taking it out of the "NumberFormat" function, math worked
normally.
<Whew!>
Take care all!
Lee
| -----Original Message-----
| From: Stacy Young [mailto:[EMAIL PROTECTED]]
| Sent: Tuesday, October 01, 2002 8:46 PM
| To: CF-Talk
| Subject: RE: Math In MX?
|
|
| How bout:
| <cfset Answer = CountMale.RecordCount/Responses>
|
|
| -----Original Message-----
| From: Lee Fuller [mailto:[EMAIL PROTECTED]]
| Sent: Tuesday, October 01, 2002 11:31 PM
| To: CF-Talk
| Subject: RE: Math In MX?
|
| Now THAT's odd... 'cause we can't get it to BE that answer.
|
| (and actually.. I made a type-o in the var name in my
| message. But it is correct in the code.)
|
|
|
| | -----Original Message-----
| | From: jon hall [mailto:[EMAIL PROTECTED]]
| | Sent: Tuesday, October 01, 2002 7:39 PM
| | To: CF-Talk
| | Subject: Re: Math In MX?
| |
| |
| | I can't make 379/1093 = anything but 0.346752058554 on my MX box...
| |
| | --
| | jon
| | mailto:[EMAIL PROTECTED]
| |
| | Tuesday, October 1, 2002, 10:18:40 PM, you wrote:
| | LF> Ok.. I'm confused...
| |
| | LF> If...
| |
| | LF> #countmale.record# = 379 (which a cfoutput confirms)
| |
| | LF> And...
| |
| | LF> #responses# = 1093 (which a cfoutput confirms)
| |
| | LF> Then how the heck does...
| |
| | LF> <cfset Answer = #CountMale.RecordCount#/#Responses#>
| |
| | LF> End up being 0.0111569031498 ?
| |
| | LF> The answer is simple math.. And SHOULD be..
| | 0.346752058554. Which,
| | LF> when multiplied by 100 yields the percentage.
| |
| | LF> Sooo.... What am I missing?
| |
| |
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm