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

79
Vistas
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
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