Mamea
asked on
Ceiling Tag
Hi,
I inherited an application and I am looking at the following code that is calculating the number of questions you must answer correctly so you can pass the test.
#ceiling(getquestions.reco rdcount*re quest.pass ingpercent /100)#
request.passingpercent is always 75
for this example getquestions.recordcount is 67.
When you do the mathematical computation the answer is 50.25. Why is the tag rounding this up to 51? What I need to be displayed is 50 because if you have a test of 67 questions you have to answer 50 or more to pass (and passing is 75%).
Thanks
Thanks
I inherited an application and I am looking at the following code that is calculating the number of questions you must answer correctly so you can pass the test.
#ceiling(getquestions.reco
request.passingpercent is always 75
for this example getquestions.recordcount is 67.
When you do the mathematical computation the answer is 50.25. Why is the tag rounding this up to 51? What I need to be displayed is 50 because if you have a test of 67 questions you have to answer 50 or more to pass (and passing is 75%).
Thanks
Thanks
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Ceiling() will always round up to the nearest whole number. so even 50.01 will round up to 51. If you want to always round down, use Int(). Use Round() to just round to the nearest whole number (either up or down)
also you can read this
http://kb.adobe.com/selfservice/viewContent.do?externalId=kb401292 but I think you better of with my above post
http://kb.adobe.com/selfservice/viewContent.do?externalId=kb401292 but I think you better of with my above post
Just change ceiling( to int(
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you all for your help! I appreciate it!
<cfoutput>#round(67*(75/10