Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

182
Vistas
How do I make a money to levels calculator in Javascript?

my aim is to make a calculator which will allow the user to input their level and how many runes(Elden Ring's in game currency) they have currently. I then want to have my code calculate how many levels the user can purchase with the amount of runes they have.

For example, let's say I am level one and I have 2,000 runes, judging by the array we have called 'runearray' the user will only be able to level up to level 3. Am I going the right way about implementing this? Here's a pic of what the user will see...

User's POV

        <div class="calcrune col-md-12">
            <span class="runecalc">Current Level: <input id="levelcurrent1" type="text" min="1" max="712"></span>
            <span class="runecalc">Current Runes: <input id="runecurrent1" type="text" min="1" max="712"></span>
            <button class="runecalc" onclick="levelCalc()">Calculate Levels</button>
            <span>Level Upgrades: <span id="runes1"></span></span>
        </div>
function levelCalc() {
        var levelcurrentstring = document.getElementById('levelcurrent1').value;

        var levelcurrentminus1 = parseInt(levelcurrentstring);

        var runecurrentstring = document.getElementById('runecurrent1').value;

        var runecurrentvalue = parseInt(runecurrentstring);

        var levelcurrent = levelcurrentminus1 - 1;

        const runearray = [/* level 1 to 2 = */ 673, /* level 2 to 3 = */ 689, /* level 3 to 4 = */ 706....
        ];

        var newrunearray = runearray[levelcurrent];

        for (i = levelcurrent; i < runecurrent; i++) {
            var newrunearray = newrunearray + runearray[levelcurrent + 1];
        }

        document.getElementById('runes1').textContent = newrunearray;
}
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda