5
I’m afraid the integer values (example 350) and a real number (example 3.50), need to divide one by the other precisely (3.50 / 350) the result would be 0.01.
var tamanho = parseInt($("#tamanho").val());
var valor = $("#valor").val();
var valorMl = valor / tamanho;
console.log(valor, tamanho, valorMl);
valor
returns 3,50
.
tamanho
returns 350
.
valorMl
returns NaN
.
Opa thanks was that same, I could also change in the maskmoney of jquery, I used replace to do the calculation and in the input it keeps appearing the comma, thanks @samirbraga, happy new year!
– Bruno Cabral
You’re welcome, @Brunocabral. Happy New Year to you too :).
– Samir Braga