0
Good afternoon!
I am trying to compare numbers with Jquery, they are values with decimals or not. when the value goes up to 999 everything works perfectly, but above this does not work as it should.
Example: value_mo_contract = 510.00
total_mobra_orc_calc = 1000
$(document).ready(function(){
var valor_mo_contrato_s = parseFloat($("#valor_mo_contrato").val()).toFixed(2);
var valor_mobra_s = parseFloat($("#total_mobra_orc_calc").val()).toFixed(2);
if (valor_mo_contrato_s < valor_mobra_s) {
$("#valor_unitario_orc_check").text("O Sistema sugere que o Fiscal verifique o valor de Mao de Obra.");
$("#valor_unitario_orc_check").css({"color": "red"});
}
});
Andre, probably this occurring because your decimal separator should be as a comma and not a point. if you can put what values you are entering in each field. editing your question
– andrepaulo
This with dot, but is there any problem for example if one of the numbers comes without separator? Type A 510.00 compared to 1000
– Andre Maia