The problem is that when CYOriginal EQ 0 the following code is run

        NumberFormat(100*Change/CYOriginal, '__._')

and as CYOriginal=0 then you cannot divide (100*Change) by 0

HTH

Mike

-----Original Message-----
From: Drechsler, Jennifer [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 19, 2001 0:39
To: CF-Talk
Subject: IIF Problem


Can anyone tell me why this isn't working.  I can't stare at this any
longer.  The output runs fine until there is a CYOriginal = 0.  Blows up.
Help, Please.

<CFOUTPUT>#IIF(CYOriginal EQ 0, IIF(Requested GT 0, DE("100.0"), DE("0.0")),
NumberFormt(100*Change/CYOriginal, '__._'))#</CFOUTPUT>

I get this error:

Error Diagnostic Information

An error occurred while evaluating the expression:


#IIF(CYOriginal EQ 0, IIF(Requested GT 0, DE("100.0"), DE("0.0")),
NumberFormat(100*Change/CYOriginal, '__._'))#



Error near line 92, column 43.
----------------------------------------------------------------------------
----

Division by zero is not allowed


The error occurred while processing an element with a general identifier of
(#IIF(CYOriginal EQ 0, IIF(Requested GT 0, DE("100.0"), DE("0.0")),
NumberFormat(100*Change/CYOriginal, '__._'))#), occupying document position
(92:42) to (92:153) in the template file
E:\OTHERSITES\FINANCE\BUDFY02\OBJDETAIL.CFM.


Jennifer Drechsler
SFPUC, ITS
1155 Market St., 4th Fl.
SF, CA 94103
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to