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

321
Visualizações
How can I calculate the minimum of two numbers?

I have a calculation sample/formula that outputs the site score mainly based on these parameters,

  • Page Views
  • Average Session Duration (Floating point number that is in minutes and seconds i.e. 1 minute 30 seconds would be 1.30.
  • Top 3 Geolocations from which the website is most frequently visited and their percentages (e.g. (UK 30%, US 16%, Germany 10%).
  • Site Revenue (Monthly Avg. Net)

This works fine in MS Excel.

Here's the calculation sample/formula

Calculation image removed because of client safety and policy.

Now the thing is that I am trying to reproduce this exact formula into JavaScript code, and I am not that familiar with JavaScript Maths, plus some things from the calculation sample are slightly unclear to me.

Here's what I tried:

const siteEvaluationFormula = ((PageViews - 100000) / 750000 * AvgSessionDuration * (totalPercent * 60) + ... nothing after this I just gave up in confusion);

I'm stuck when it comes to calculating the minimum of two numbers. What do I use to calculate the minimum in JavaScript?

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

0

I think you are looking for Math.min to complete your formula

const siteEvaluationFormula = Math.min(60, ((PageViews - 100000) / 750000 * AvgSessionDuration * (totalPercent * 60) + Math.min(40, SiteRevenue/5000*40));
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