# Find formula used on a website's weightlifting calculator

Discussion in 'Programming & Scripting' started by Extreme Realism, Feb 10, 2019 with 1 replies and 371 views.

1. ### Extreme RealismEnthusiast

Messages:
131
Ratings:
16
2. Similar Threads

Replies:
2
Views:
443

Replies:
4
Views:
261

Replies:
3
Views:
273

Replies:
1
Views:
131

Replies:
4
Views:
2,382
3. ### shindaRetiredRetired

Messages:
2,219
Ratings:
1,213   Have fun...

Code:
```           jQuery('#max').keyup(function(){
var output = jQuery('#instructions').html();
var maxr =  parseInt(jQuery('#max').val());
var low = maxr-30;
var high = maxr+70;

var p = new Array();
var pr = new Array();

p = 925;
pr = 2;

p = 885;
pr = 3;

p = 850;
pr = 4;

p = 750;
pr = 6;

p = 650;
pr = 8;

p = 550;
pr = 10;

var counter = 0;

if(maxr > 50) {
jQuery(".entry-content p").slideUp();
jQuery("#googlead").show();
//awardAction("pyramid", window.location.href);
for(var x=low; x<high; x = x+10){
counter++;
output += "<div style='float:left;width:168px; margin-right:15px; margin-top:15px;'>";
output += "<div style='border-bottom:solid 1px #666666'><strong>1RM = "+x+"</strong></div>";
for(var t = p.length-1; t>= 0; t--) {
var weight =  Math.round(Math.floor((p[t] * x / 1000))/5)*5;
output += weight + " x " +  pr[t] +  " <span style='font-size:70%'> (" +  (p[t]/10) + "%)</span><br>";
}

var weight =  Math.round(Math.floor((p * x / 1000))/5)*5;
output += weight + " x " +  pr +  " <span style='font-size:70%'> (" +  (p/10) + "%)</span><br>";

output += "</div>";
if(counter % 3 == 0) output += "<br clear='all'><br>";
}

jQuery('#pyramidOutput').html(output);
//_gaq.push(['_trackEvent', 'calculator', 'pyramidcalc','<?=the_permalink();?>']);
}
});

```