fix: preserve zero values in formatTable
Fix formatTable to use null/undefined check instead of falsy check, so numeric 0 values are correctly displayed instead of '-'.
This commit is contained in:
parent
d250d6efa7
commit
6d1a26a315
@ -34,7 +34,8 @@ function formatTable(data, columns) {
|
||||
data.forEach(row => {
|
||||
output += '|';
|
||||
columns.forEach(col => {
|
||||
const value = String(row[col.key] || '-');
|
||||
const cellValue = row[col.key];
|
||||
const value = String(cellValue !== undefined && cellValue !== null ? cellValue : '-');
|
||||
output += ` ${value.padEnd(widths[col.key] - 1)}|`;
|
||||
});
|
||||
output += '\n';
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user