Skip to main content
I'm looking to add rounding to some, but not all, of the products in this formula. The formula currently works fine as is, however we now need to add other products. The current decimal setting is set to "0" so all of the values are automatically rounded by Salesforce - we are changing that to "2" and hoping to manage the rounding within the formula itself, however I can not seem to get it to validate - anyone?

 

 

IF(

ISPICKVAL(PricebookEntry.Product2.Family, "Dues"),

IF( PricebookEntry.Product2.ProductCode = "DUES_STANDARD",

IF( Order.CVRSOS__Job__r.CVRSOS__HourlyRate__c >= 11.01,

Order.CVRSOS__Job__r.CVRSOS__HourlyRate__c * 2.5 + Additional_Amount__c ,

Order.CVRSOS__Job__r.CVRSOS__HourlyRate__c * 2.0+ Additional_Amount__c ),

IF(

PricebookEntry.Product2.ProductCode = "DUES_MULTIPLIER",

Order.CVRSOS__Job__r.CVRSOS__HourlyRate__c * PricebookEntry.Product2.CVRSOS__RateMultipler__c+ Additional_Amount__c ,

IF(

PricebookEntry.Product2.ProductCode = "DUES_MULTIPLIER_NOT_ROUNDED",

Order.CVRSOS__Job__r.CVRSOS__HourlyRate__c * PricebookEntry.Product2.CVRSOS__RateMultipler__c+ Additional_Amount__c ,

IF(

PricebookEntry.Product2.ProductCode = "DUES_PERCENTAGE",

Order.CVRSOS__Job__r.JOB_BASE_SALARY__c * Order.CVRSOS__Job__r.JOB_D_STRUC_FACT__c + Additional_Amount__c ,

UnitPrice+ Additional_Amount__c

)

)

),

0.0

))

 

 
3 Antworten
  1. 11. Dez. 2018, 18:55
    Hi,

     

    you can use the "ROUND" function to specify whether you want to round to the first [ROUND ("your number", 1)] or second decimal [ROUND("your number", 2)].

     

    So for example ROUND(Order.CVRSOS__Job__r.CVRSOS__HourlyRate__c * PricebookEntry.Product2.CVRSOS__RateMultipler__c+ Additional_Amount__c,1) would round that expression to the first decimal.
0/9000