Skip to main content
Participant
October 3, 2019
Question

Math Problem

  • October 3, 2019
  • 1 reply
  • 179 views

I have a report that compares one figure against the total of several figures and compares them. If they are the same, they print in black. If the one figure is more than the total of the several figures, the output prints in red. If the one figure is less than the total of the several figures, the output prints in green. (The CF file is attached as a docx.)

 

The report currently outputs 49 pairs of figures. Eight of those pairs, in all cases of which the figures are the same, print in the wrong colors, three in red and five in green. The other 41 pairs, comprising  several in all three possibilities, print correctly.

 

Any ideas? Thanks.

 

 

-Dale

    This topic has been closed for replies.

    1 reply

    BKBK
    Community Expert
    Community Expert
    October 4, 2019

     

     

     

     

     

     

    The only odd thing I see is:

     

     

     

     

    <cfoutput>
      <tr style="display:none">
         <td>
          #cPayable#
         </td>
         <cfset FFPTotal = FFPTotal + #cPayable# />
      </tr>
    </cfoutput>

     

     

     

     

    It is odd for 2 reasons:

    1) it has 1 <td> instead of 2.

    2) it incorrectly adds a cfoutput tag within a cfoutput tag.

     

    Was it your intention to do this instead:

     

     

     <tr style="display:none">
    <td>
     &nbsp;
     </td>
     <td>
     #cPayable#
      </td>
    </tr>
    <cfset FFPTotal = FFPTotal + #cPayable# />