I want to remove the number to the left side of the decimal if that digit is less than 1. Basically, I want to remove a zero if its there.
Meaning 0.25 would become .25 but 1.50 would remain 1.50
$(document).ready(function() {
$('#mytabl').DataTable({
"searching": true,
"pageLength": 40,
"scrollX": true,
"paging": false,
"info": false,
drawCallback: () => {
const table = $('#mytabl').DataTable();
const tableData = table.rows({
search: 'applied'
}).data().toArray();
const totals = tableData.reduce((total, rowData) => {
total[0] += parseFloat(rowData[1]);
total[1] += parseFloat(rowData[2]);
return total;
}, [0, 0]);
$(table.column(1).footer()).text(totals[0]);
$(table.column(2).footer()).text(totals[1]);
}
})
});