Format a number into a datatable

Format a number into a datatable

luis02luis02 Posts: 2Questions: 1Answers: 0
edited March 2022 in Free community support

Format a table in JavaScript. I have 1 table with the following data CUNIT: .056 What I want: 0.056 In my database my procedure gives me a result of 0.056. Use the DataTables | Table plugin for jQuery. What I want to do is in the image:https://i.stack.imgur.com/oAI6x.png
code: js

var tbl_ctsunit;
function List_CTSUnit(id){
tbl_ctsunitario = $("#tbl_ctsunit").DataTable({
"ordering": false,
"bLengthChange": true,
"searching": {"regex":false},
"lengthMenu": [[10,25,50,100,-1],[10,25,50,100, "All"]],
"pageLength":10,
"destroy": true,
"async": false,
"processing": true,
"bPaginate":false,
"bFilter": false,
"bInfo":false,
"sDom":'t',
"ajax":{
"url": "../controller/datos/controller_list_ctsunit.php",
type:'POST',
data:{
id:id
}
},
"columns":[
{"data":"PRODUC"},
{"data":"T_UNIT"},
{"data":"CUNIT"},
],
"language":idioma_espanol,
select: true
});
}

Answers

Sign In or Register to comment.