3 Replies Latest reply on Sep 13, 2009 8:05 PM by RickWhitelaw

    Please help

    eekamouse

      Title

      Please help

      Post

      Hi everyone, i have four number fields f1, f2 , f3 f4 and once calculation that adds them

       

      f_all = f1+f2+f3+f4

       

      for some reason if I enter 59.90 in any of the four fields f_all calculates it as 59.9

       

      I need to be able to have an accurate character length calculated for f_all for further calculations so 59.90 should calculate as 4 characters. I have tried using the number formatting but that did not work it only displayed correctly.

       

      any thoughts?

       

      eek 

       

       

        • 1. Re: Please help
          davidhead
            

          Try this calculation:

           

          Let ([

          sum = f1 + f2 + f3 + f4;

          sum = Round ( sum; 2 );

          int = Int ( sum );

          mod = Mod ( sum ; 1 )

          ];

          int & If ( mod; Left ( mod & "0"; 3 ); ".00" )

          ) 

          • 2. Re: Please help
            comment_1
              

            eekamouse wrote:
            I need to be able to have an accurate character length calculated for f_all for further calculations

            What are these further calculations? For any numeric calculation, 59.9 is exactly the same as "59.90" and any trailing decimal zeros are entirely redundant.


            • 3. Re: Please help
              RickWhitelaw
                

               Comment wrote:

               

              "What are these further calculations? For any numeric calculation, 59.9 is exactly the same as "59.90" and any trailing decimal zeros are entirely redundant."

               

              I guess the "further calculations" could be text calculations . . . non-numeric anyway. I've never had the need to track trailing zeroes but certainly need leading zeroes to make certain calculations work. On the other hand, it's late . . . .

               

              RW