4 Replies Latest reply on Jun 16, 2010 2:09 PM by imgaryshap

    TextStyleAdd function issue with Dollar amounts

    imgaryshap

      Title

      TextStyleAdd function issue with Dollar amounts

      Post

      I am using FMP 8 on a MAC.

       

      I have a field where the user can manually enter the budget called Production Cost Per Episode (ProdCPE).

       

      I have another field with a drop down selection called Budget Type where the user can select either "Working" or "Contractual"

       

      When I run a report, I would like the following to happen:

      When Budget Type is "Working", ProdCPE will appear in Italics.  When Budget Type is "Contractual" it will remain as is.

       

      I also want the number format to appear in dollars $123,456   (with the dollar symbol and no decimals)

       

      I figured out how to get the number to appear in italics using the following calculation:

       

      If (Budget Type="Working"; TextStyleAdd(ProdCPE;Italic); ProdCPE)

       

      However, in order for this calculation to work, I have to remove the dollar formatting from the field so my numbers are just appearing as entered:    123456   rather than: $123,456

       

      Any suggestions on how to maintain the dollar formatting along with the change in style to italics?

       

      Thanks so much!

       

      -G.

        • 1. Re: TextStyleAdd function issue with Dollar amounts
          ryan

           


           

          If (Budget Type="Working"; TextStyleAdd(ProdCPE;Italic); ProdCPE)

           

          However, in order for this calculation to work, I have to remove the dollar formatting from the field so my numbers are just appearing as entered:    123456   rather than: $123,456

           

          Any suggestions on how to maintain the dollar formatting along with the change in style to italics?

           

          Thanks so much!

           

          -G.


           

          Have you tried inserting the $ sign in your calculation?

          Try this:

           

          If (Budget Type="Working"; "$" & TextStyleAdd(ProdCPE;Italic); ProdCPE)

           

          or if you want the $ sign to be in italics

           

          If (Budget Type="Working"; TextStyleAdd( ("$" & ProdCPE ) ;Italic); ProdCPE)

          • 2. Re: TextStyleAdd function issue with Dollar amounts
            imgaryshap

            helpful - thanks so much - but it does not fully solve the problem. it still does not format the number in the aesthetic I'd like it to.  It does not not add the comma to the number.

             

            i would like the number to look like this "$123,456"  not  "$123456"

             

             

             

             

            • 3. Re: TextStyleAdd function issue with Dollar amounts
              philmodjunk

              Back before we had the options described in this post, we sometimes used two fields stacked on top of each other, each with different formats specified for the field.

               

              Field 1 could be If ( BudgetType = "Working" ; Production Cost ; "" ) set to return a number type. Format this field as currency and also with italics.

               

              Field 2 could be If ( BudgetType ≠ "Working" ; Production Cost ; "" ). Format this field as currency but don't format with italics as its text style.

               

              You can't edit the Production Cost field on this layout without scripting a custom dialog or some such to popup when the field is clicked, but it will work for printing/previewing reports.

               

              Edit note: Rewrote last sentence to improve clarity.

              • 4. Re: TextStyleAdd function issue with Dollar amounts
                imgaryshap

                thanks.  that did it.