3 Replies Latest reply on May 5, 2010 1:11 PM by mrvodka

    Calculations in a text box

    HB

      Title

      Calculations in a text box

      Post

      I am sure there is an easy way to make a small calculation in a text box based on a merge field without making a separate field in the underlying table, isn't there.

       

      In a layout in Browse mode I want a text to show someones overtime pay.

      I have a reg pay field called RegPay

       

      I tried:

       

      =<<RegPay>>*1.5

       

      but of course I get :

       

      =31*1.5

       

      Thanks in advance!

        • 1. Re: Calculations in a text box
          ninja

          Howdy,

           

          It sounds like its working as described.


          HB wrote:

          In a layout in Browse mode I want a text to show someones overtime pay.


          I think, however, you want a number to show someone's overtime pay, no?

           

          Make it a calculation field (resulting in number) and set the calculation to be as you've described: 

          Table::RegPay * 1.5


          • 2. Re: Calculations in a text box
            HB

            Thanks Nina - yes I meant a txt object showing a number in text format - I guess.

             

            I wanted to avoid adding more fields to the underlying table - which I think is what you are suggesting. I'd have to make quite a few of these fields which I would rather not if there was a simpler way.

             

            I am thinking there isn't - thanks for helping a newbie!!!

            • 3. Re: Calculations in a text box
              mrvodka

              If you have FMP11, you can set a global variable to a value and then use a merge variable on the layout.

               

              Set Variable [ $$overtime; RegPay & " * 1.5 = " & RegPay * 1.5 ]

               

              Or if you dont have FMP11 but still have 9 or 10, you can use a web viewer to do something similar. Make sure that you turn off the pen pattern and also uncheck the checkboxes under the web viewer options.

               

               

               

              "data:text/html,
              <html>
              <head></head>
              <body style='border: 0; margin: 0'>

              "
              & RegPay & " * 1.5 = " & RegPay * 1.5

              &

              "</body>

              </html>"