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

72
Views
Get a result for tolerance m7

can somebody help me to solve this problem? I'm trying to get a difference between a lower tolerance and an upper tolerance. I've found a site that gives me the .js calculation for the upper and lower tolerance, it also gives me the maximum and minimum diameter, but I also want to get the diference between those results. I've tried to find all over internet but failed at finding something. Here is the link to the code and .js files that i'm using.

https://jsfiddle.net/my974Ljh/1/

I have another code iqual to this one, with one more script. But this script gives me the result I want but I have to insert manualy the inputs.

<script type="text/javascript">
    function id(el) {
        return document.getElementById( el );
        }
    function total( un, diamx ) {
        return parseFloat(un.replace(',', '.'), 10) - parseFloat(diamx.replace(',', '.'), 10);
        }
    window.onload = function() {
        id('diamn').addEventListener('keyup', function() {
        var result = total( this.value , id('diamx').value );
        id('total').value = String(result.toFixed(3)).formatMoney();
        });

        id('diamx').addEventListener('keyup', function(){
        var result = total( id('diamn').value , this.value );
        id('total').value = String(result.toFixed(3)).formatMoney();
        });
        }

    String.prototype.formatMoney = function() {
        var v = this;

        if(v.indexOf('.') === -1) {
        v = v.replace(/([\d]+)/, "$1,00");
        }

        v = v.replace(/([\d]+)\.([\d]{1})$/, "$1,$200");
        v = v.replace(/([\d]+)\.([\d]{2})$/, "$1,$2");
        v = v.replace(/([\d]+)([\d]{3}),([\d]{2})$/, "$1.$2,$3");

        return v;
        };
    </script>

Hope you can help me with this one. I know that I can simplify the code but I'm trying to solve one problem at a time.

Thank you so much.

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!