Spaces:
Sleeping

doluong6 commited on
Commit
e892dfd
·
verified ·
1 Parent(s): 3ebe3d6

Update static/script.js

Browse files
Files changed (1) hide show
  1. static/script.js +7 -1
static/script.js CHANGED
@@ -1064,7 +1064,13 @@ async function hienThiBangGia6() {
1064
  data.rows.forEach(row => {
1065
  tbodyHtml += "<tr>";
1066
  row.forEach(cell => {
1067
- tbodyHtml += `<td>${cell}</td>`;
 
 
 
 
 
 
1068
  });
1069
  tbodyHtml += "</tr>";
1070
  });
 
1064
  data.rows.forEach(row => {
1065
  tbodyHtml += "<tr>";
1066
  row.forEach(cell => {
1067
+ // Nếu là số, định dạng theo nhóm 3 số
1068
+ if (!isNaN(cell) && cell !== "") {
1069
+ const formatted = Number(cell).toLocaleString("vi-VN");
1070
+ tbodyHtml += `<td>${formatted}</td>`;
1071
+ } else {
1072
+ tbodyHtml += `<td>${cell}</td>`;
1073
+ }
1074
  });
1075
  tbodyHtml += "</tr>";
1076
  });