/t5/coldfusion-discussions/quot-division-by-zero-is-not-allowed-quot-error/td-p/809617May 02, 2006
May 02, 2006
Copy link to clipboard
Copied
Hi all, I am using the syntax below:
<cfset PercentageOfConversionTotalLG =
(totalCases.RecordCount/staffMember.RecordCount)*100/>
basically two recordset totals divided to give me a figure,
sometimes this figure turns out at 0, so obviouslly 0% and that is
what it shows, but other times it shows this error: Division by
zero is not allowed, and refers to the above line of code... is
there a way around this error? does anyone know please?
Thanks Paross, I just realised the number error was due to me
using decimalFormat on my output, but i need that so have used your
suggestion and it works a treat, many thanks