How to make this function calculate with comma instead of point? [duplicate]

0
<script type="text/javascript">
$(document).ready(function() {
  $("#somar").click(function(){
    var total = 0;
    var desconto = $("#desconto").val() != "" ? $("#desconto").val() : 0;
    $('.input').each(function(){
      var valor = Number($(this).val());
      if (!isNaN(valor)) total += valor;
    });
    total = total - desconto;
    $(".resultado").html(total.toFixed(2));
  });
});
</script>
<script>
  function imprimir(mesmo){
    var conteudo = mesmo.parentElement.innerHTML,
        tela_impressao = window.open('about:blank');

    tela_impressao.document.write(conteudo);
    tela_impressao.window.print();
    tela_impressao.window.close();
  }
</script>
    
asked by anonymous 15.09.2017 / 14:17

0 answers