Skip to main content

We have a Flow with a formula that looks at a Discount Code object and pulls in any relevant Discount Percentage or Discount Amount.  The Discount Percentage part of the formula works perfect.  The Discount Amount, although it is set as a Currency field (16,2) with 2 decimal places, returns many more decimal places.  As an alternative solution, I tried to create  a Discount_Amount_Number__c Number field that referenced the Discount_Amount__c currency field in the formula, but that is throwing an unhandled exception in the Flow.

 

Here are two formulas I've tried.  What am I doing wrong or what can I do/change to just turn the value of the Discount Amount in the Flow formula?

 

IF(

    NOT(ISBLANK({!Get_Discount_Codes_with_Discount_Percentage.Discount_Amount__c})), 

    {!Get_Discount_Codes_with_Discount_Percentage.Discount_Amount__c}, 

    IF(

        NOT(ISBLANK({!Get_Discount_Codes_with_Discount_Percentage.Discount_Percent__c})),  

        {!Get_EventClass_Records.Course__r.Course_Fee__c} * ({!Get_Discount_Codes_with_Discount_Percentage.Discount_Percent__c} / 100),  

        0 

    )

)

 

ROUND(

   IF(

      NOT(ISBLANK({!Get_Discount_Codes_with_Discount_Percentage.Discount_Amount__c})), 

      {!Get_Discount_Codes_with_Discount_Percentage.Discount_Amount__c}, 

      IF(

         NOT(ISBLANK({!Get_Discount_Codes_with_Discount_Percentage.Discount_Percent__c})),  

         {!Get_EventClass_Records.Course__r.Course_Fee__c} * ({!Get_Discount_Codes_with_Discount_Percentage.Discount_Percent__c} / 100),  

         0 

      )

   ), 

   2

)

Thanks for you help.

John

Currency Formula in Flow - too many Decimal places

 

discountamount.PNGdiscount amount screenshot.PNG

 

 

#Formulas

0/9000