Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

185
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!