Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

170
Visualizações
Biweekly and weekly calculation help using javascript

Good day!

I have a question. I have an auto loan calculator that gets a monthly payment perfectly below

var M; //monthly mortgage payment
var P = amount; //principle / initial amount borrowed
var I = Number(rate) / 100 / 12; //monthly interest rate
var N2 = term;
M2 = monthlyPayment(P, N2, I);
function monthlyPayment(p, n, i) {
    return p * i * (Math.pow(1 + i, n)) / (Math.pow(1 + i, n) - 1);
}

I am running into an issue getting the correct biweekly and monthly payment. I assumed that if term was 26 payments (for one year biweekly as an example) and I replaced the 12 in variable I to 18 ... it would work, but to no avail. Can anyone give me an idea what I am doing wrong?

about 4 years ago · Juan Pablo Isaza
2 Respostas
Responde à pergunta

0

Math isn't my strongest subject, but you are essentially canceling the value of Math.pow() when you divide it by the exact same value in your second math.pow(). Then you are attempting to subtract it by 1. You are forgetting a bracket.

= (Math.pow(1+i,n)) / (Math.pow(1+i,n)) -1;

about 4 years ago · Juan Pablo Isaza Relatório

0

I have since learned that U.S. and Canada (where I am from) calculate biweekly payments differently. It was throwing me off since my numbers didn't match some popular online calculators. Many calculators simply make the term for bi weekly 24 payments and the interest variable 24. In Canada the term variable has to be 26 and the interest variable also 26.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda