Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Attached Formula image to add in javascript

Status
Not open for further replies.

Raj Kumar

Programmer
Jun 24, 2020
1
US
Hello Guys,

I need some help. Attached is the formula image which I want to use in Javascript but I dont know how to do the superscript (n) in Javascript

Here is my code

<script>
function myFunction() {
var pmt;
var PV = 201508;
var i1 = 3.625;
var i2=3.625/100;
var i = i2/12;
var n= 360;

pmt = PV * i(1+ i)/(1 + i) - 1;
}
</script>

Can someone tell me how I can use the attached formula image in javascript.

Thanks

Raj
 
 https://files.engineering.com/getfile.aspx?folder=66258f2f-cb6d-463f-9286-de93f7080082&file=formula.jpg
The superscript parts represent "power". Example:

2 [sup]4[/sup] = 2 * 2 * 2 * 2

In javascript, this would be Math.pow(2, 4)


-George
Microsoft SQL Server MVP
My Blogs
SQLCop
twitter
"The great things about standards is that there are so many to choose from." - Fortune Cookie Wisdom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top