function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
bhorakiforcebhorakiforce 

Convert PMT formula from Javascript to Salesforce formula notation

Formula in Java Script ---------------------- pmt = ( ((ir/100)/12)* ( pv * Math.pow ( (((ir/100)/12)+1), (np*12)) + fv ) ) / ( ( ((ir/100)/12)+ 1 ) * ( Math.pow ( (((ir/100)/12)+1), (np*12)) -1 ) );
Navatar_DbSupNavatar_DbSup

Hi,

 

Try the below formula as reference:

 

( ((ir__c/100)/12)* ( pv__c * ( (((ir__c/100)/12)+1)^(np__c*12)) + fv__c ) ) /

 ( ( ((ir__c/100)/12)+ 1 ) * (( (((ir__c/100)/12)+1)^(np__c*12)) -1 ) )

 

Did this answer your question? If not, let me know what didn't work, or if so, please mark it solved. 

Tania SamuelTania Samuel
PMT = ((InterestRate/100)/12)*(NetLoan*((((InterestRate/100)/12)+1)^PeriodInYears*12))/((((InterestRate/100)/12)+ 1 )*(((((InterestRate/100)/12)+1)^PeriodInYears*12)-1))
 
It is closest formula found.
 
Martina RuescaMartina Ruesca
PMT= ( Net Loan * (Anual Interest Rate /100)/12) / (1 - (1 + (Anual Interest Rate /100)/12) ^ (- Months ))
This one is exact.