fix decimals number

This commit is contained in:
amazuecos
2025-02-18 08:26:18 +00:00
parent eea415fb47
commit 4409ed8652
2 changed files with 14 additions and 1 deletions

View File

@ -543,7 +543,7 @@
return '<?= lang('MaquinasTarifasImpresions.colorhq') ?>';
}
},
{ 'data': 'precio',render : (d) => `<span class="autonumeric">${d}</span>` },
{ 'data': 'precio',render : (d) => `<span class="autonumeric-decimal" data-decimal-places="6">${d}</span>` },
{ 'data': 'margen',render : (d) => `<span class="autonumeric">${d}</span>` },
{
data: actionBtns,

View File

@ -26,6 +26,19 @@ export const initAutonumeric = () => {
});
}
})
$("span.autonumeric-decimal").each(function () {
let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)
if (!autoNumericInstance) {
new AutoNumeric(this, {
digitGroupSeparator: ".",
decimalCharacter: ",",
allowDecimalPadding : 'floats',
decimalPlaces: $(this).data('decimal-places'),
unformatOnSubmit: true,
});
}
})
// $(':input[type="number"]').each(function(){
// $(this).attr('type','text')
// let autoNumericInstance = AutoNumeric.getAutoNumericElement(this)