0
After returning the value to my form, I want to format it to show the decimals correctly. I’ve made several attempts using jQuery Mask, but I haven’t had any success. I appreciate if anyone can help.
$(document).ready(function () {
$("#categoriaPrecificacao").change(function () {
var categoria_selecionada = $(this).children("option:selected").val();
var urlCompleto = "/Estacionar/ObterValorHoraPrecificacao/";
$.ajax({
dataType: 'json',
method: "GET",
url: urlCompleto,
data: { id: categoria_selecionada },
success: function (data) {
console.log(data["results"].valorHora);
$(".ValorHora").val(data["results"].valorHora);
$('.ValorHora').mask('#.##0,00', { reverse: true });
}
});
});
});
a doubt, the script is even applied? no errors in the right console?
– Ricardo Pontual
@Ricardopunctual, no error, the answer is coming correctly
– Harry
@Ricardopontual, I already found a solution, but thank you
– Harry