1 Reply Latest reply on Sep 16, 2013 11:03 AM by philmodjunk

    Why does this evaluate the way it does?

    Kirk_1

      Title

      Why does this evaluate the way it does?

      Post

           $discount_pct_cust = 70.3

           $Toplinenumber1 = 257.22

           $ fsc = 28

           Let ([

                           $~num =  ( 100 - $discount_pct_cust ) * ( $toplinenumber1 / 100 )  ;

                           $~fsc = ( $~num * $fsc) / 100 ;

                           $~newRate = Round ( $~num + $~fsc ; 2 )

           ] ;

                           $~newrate

           )

           This evaluates to 329.30. But if i do it on my calculator i get 97.76 which is what im looking for...

        • 1. Re: Why does this evaluate the way it does?
          philmodjunk

               Something must be changing the value of one of your three variables before the expression evaluates. When I test your calculation in the FileMaker Advanced Data Viewer with this version of the expression:

               Let ([       $discount_pct_cust = 70.3 ;

                              $Toplinenumber1 = 257.22 ;

                              $fsc = 28 ;

                               $~num =  ( 100 - $discount_pct_cust ) * ( $toplinenumber1 / 100 )  ;

                               $~fsc = ( $~num * $fsc) / 100 ;

                               $~newRate = Round ( $~num + $~fsc ; 2 )

               ] ;

                               $~newrate

               )

               I get: 97.78