Limit to 2 decimal places

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • crmclients
    Senior Member
    • Jul 2020
    • 254

    Limit to 2 decimal places

    Hello!

    I see this in the documentation for setting a decimal

    but I can't figure out how to wrap it around my ifThen statements that are currently giving me 12 places: where testPcd=90.804597701149​ when the drop down (ESI Post, PSI Post, PSA Post....) is selected
    ifThen(testType == 'ESI Post', testPcd = (testScored/87)*100
    );
    ifThen(testType == 'PSI Post', testPcd = (testScored/82)*100
    );​

    At the end of the list (there are actually 8 options in the drop down that can affect the calculation, I am showing just 2 above) and also tried

    By themselves, the equations work great (once I figured out I needed to use the FLOAT type!)... Just need to limit the decimals. I know it's something very basic I am not aware of, thanks in advance
    Last edited by crmclients; 09-08-2022, 05:55 AM.
  • alexisc
    Senior Member
    • Aug 2019
    • 135

    #2

    Comment

    • crmclients
      Senior Member
      • Jul 2020
      • 254

      #3
      may I wasn't clear, here is what the documentation says
      • number\format(2.666667, 2) - results 2.67


      can someone help me with the actual statement i need to construct?
      • I see this in the documentation for setting a decimal​ can't figure out how to wrap it around my ifThen statement

      Last edited by crmclients; 09-08-2022, 11:14 PM.

      Comment

      • Jakub Grufik
        Senior Member
        • Aug 2022
        • 361

        #4
        Try this
        ifThen(testType == 'ESI Post', testPcd = number\format((testScored/87)*100, 2)
        );​

        Comment

        • crmclients
          Senior Member
          • Jul 2020
          • 254

          #5
          Thanks Jakub! I was missing the the *100 and a )
          This worked perfectly

          To anyone who might need, after updating the Formula, I did a MASS UPDATE on the Description field (not really using it so i just added a ".") and all records recalculated to 2 decimals

          Thanks again!

          Comment

          Working...