title: Calc price based on parseInt
body: <p>I have two inputs, where user types <code>width</code> and <code>height</code> of a product (let's say in mm). So min price is $250 until <code>width=50</code> and <code>height=20</code>. Then I want to increase total price by $25 every time width OR height edited by 10mm. So total should be $275 if <code>w=60 and h=20</code> (or <code>w=50/h=30</code>); $300 - when <code>w=60 and h=30</code>...</p>
  
  <p>Now with my poor jquery knowledge I made this monster <a href="https://jsfiddle.net/fkqotzzb/" rel="nofollow noreferrer">https://jsfiddle.net/fkqotzzb/</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var basePrice = 250;
  var priceForSm = 50;
  var price300 = basePrice + priceForSm;
  var price450 = price300 + (priceForSm * 3);
  var price700 = price450 + (priceForSm * 5);
  var price950 = price700 + (priceForSm * 5);
  
  $("#stwidth, #stheight").keyup(function () {
  
   var stwidth = parseInt($("#stwidth").val(), 10);
   var stheight = parseInt($("#stheight").val(), 10);
  
   if (stwidth &gt; 113) {
    $("#stwidth").val("113");
   }
    
    if (stheight &gt; 62) {
    $("#stheight").val("62");
   }
  
   if (stwidth &gt;= 50 &amp;&amp; stheight &gt;= 20 || stwidth &gt;= 110 &amp;&amp; stheight &gt;= 10) {
    $(".stamp-full-price span").html(basePrice);
  
   }
  
   if (stwidth &gt;= 30 &amp;&amp; stheight &gt;= 60 || stwidth == 80 &amp;&amp; stheight == 20 || stwidth &gt;= 60 &amp;&amp; stheight &gt;= 30 || stwidth &gt;= 40 &amp;&amp; stheight &gt;= 40) {
    $(".stamp-full-price span").html(price300);
   }
  
   if (stwidth &gt;= 110 &amp;&amp; stheight &gt;= 20 || stwidth &gt;= 110 &amp;&amp; stheight == 30 || stwidth &gt;= 70 &amp;&amp; stheight &gt;= 30 || stwidth &gt;= 60 &amp;&amp; stheight &gt;= 40 || stwidth &gt;= 50 &amp;&amp; stheight &gt;= 50 || stwidth &gt;= 40 &amp;&amp; stheight &gt;= 60) {
    $(".stamp-full-price span").html(price450);
   }
  
   if (stwidth &gt;= 110 &amp;&amp; stheight &gt;= 40 || stwidth &gt;= 110 &amp;&amp; stheight &gt;= 50 || stwidth &gt;= 90 &amp;&amp; stheight &gt;= 40 || stwidth &gt;= 80 &amp;&amp; stheight &gt;= 50 || stwidth &gt;= 60 &amp;&amp; stheight &gt;= 60) {
    $(".stamp-full-price span").html(price700);
   }
  
   if (stwidth &gt;= 100 &amp;&amp; stheight &gt;= 60 || stwidth &gt;= 111 &amp;&amp; stheight &gt;= 50) {
    $(".stamp-full-price span").html(price950);
   }
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;input type="text" name="stwidth" id="stwidth" value="50" class="form-control input-xs" maxlength="3"&gt; x &lt;input type="text" name="stheight" id="stheight" value="20" class="form-control input-xs" maxlength="2"&gt; мм
  
  &lt;div class="stamp-full-price"&gt;
    Total: &lt;span&gt;250&lt;/span&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Here prices and sizes set manually, but I don't want to set them so, it could be nice to control price by <code>width</code> and <code>height</code> separately.
  It also doesn't cover all the sizes an cases, so I can't predict what price could be shown in specific situation, and it's really monster :).</p>
  
  <p>I also have some another options next after sizes in form of radios and checkboxes. So how to get value of a total price after sizes defined to add a price of radio/checkbox?</p>