title: JavaScript displaying just 2 decimal places without the entire value
body: <p>I'm not the person who did the code,
  The problem is:
  I need a financial showing format like &quot;$15.000,00&quot; but this code just gave me 15.00
  I think it is a simple thing but I just couldn't find it yet</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-html lang-html prettyprint-override"><code>&lt;script&gt;
  function mascaraValor(valor) {
      valor = valor.toString().replace(/\D/g,"");
      valor = valor.toString().replace(/(\d)(\d{8})$/,"$1.$2");
      valor = valor.toString().replace(/(\d)(\d{5})$/,"$1.$2");
      valor = valor.toString().replace(/(\d)(\d{2})$/,"$1,$2");
      return valor                    
  }
  
  var i;
  var element = document.getElementsByClassName("customfields");
  var cunitario;
  var vanual;
  
  cunitario = document.getElementsByClassName("valor1");
  element = document.getElementsByClassName("valoranual1");
  vanual =  parseFloat(cunitario[0].innerHTML.replace(",", ".")) * 12;
  element[0].innerHTML = mascaraValor(vanual.toFixed(2));
  
  
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>