×',resistor='---
';function addResistor(){var t=makeid(5);$("#seletoresResistores").append(selector.replace("_id_",t).replace("_id_",t).replace("_id_",t).replace("_id_",t).replace("_id_",t).replace("_id_",t).replace("_id_",t)),$("#lista-resistores").append(resistor.replace("_id_",t)),$("input[data-id='"+t+"']").focus(),$(".seletorResistor input").change(function(){atualizarResistor($(this))}),$(".seletorResistor input").keyup(function(){var t=$(this).val().replace(".","");t=t.replace(/[^0-9\,]/g,""),$(this).val(t),atualizarResistor($(this))}),$(".seletorResistor select").change(function(){atualizarResistor($(this).parent().find("input"))}),$(".seletorResistor i").click(function(){var t=$(this).parent().find("input").attr("data-id");$("#"+t).parent().remove(),$("input[data-id='"+t+"']").parent().remove(),calcular()})}function atualizarResistor(t){var a=$(t).attr("data-id");$("#"+a+" span").html($(t).val()+" "+$("#sel_"+a+" option:selected").text());var e=$("#sel_"+a).val();e="K"==e?1e3:"M"==e?1e6:1,$("#"+a).attr("data-value",parseFloat($(t).val().replace(".","").replace(",","."))*parseInt(e)),calcular()}function calcular(){var a=0;$("#partes").html(""),$("#result").html(""),$("#lista-resistores .resistor").each(function(){if("0"!=$(this).attr("data-value")&&""!=$(this).attr("data-value")&&"NaN"!=$(this).attr("data-value")){var t=parseFloat($(this).attr("data-value"));a+=1/t,$("#partes").append('1'+t+"
")}}),$("#result").append("1"+a.toFixed(10)+"
");a=formatar((1/a).toFixed(2));$("#result").append(''+a+"
"),$("#total").html(a),$("#resultadoResistor .resistor").html(a)}function formatar(t){return t=parseFloat(t),console.log(t),t<1e3?t.toLocaleString("pt-br",{minimumFractionDigits:2})+" Ω":t<1e6?(t/1e3).toLocaleString("pt-br",{minimumFractionDigits:2})+" KΩ":(t/1e6).toLocaleString("pt-br",{minimumFractionDigits:2})+" MΩ"}function makeid(t){for(var a="",e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",i=e.length,r=0;r