Commit 00a07c85 by Šimon Podlipský Committed by Torkel Ödegaard

Fix: Table Panel and string values & numeric formatting (#16249)

parent ad6b11c9
......@@ -177,7 +177,7 @@ export class TableRenderer {
return '-';
}
if (_.isString(v) || _.isArray(v)) {
if (isNaN(v) || _.isArray(v)) {
return this.defaultCellFormatter(v, column.style);
}
......
......@@ -224,7 +224,12 @@ describe('when rendering table', () => {
expect(html).toBe('<td>1.230 s</td>');
});
it('number style should ignore string values', () => {
it('number column should format numeric string values', () => {
const html = renderer.renderCell(1, 0, '1230');
expect(html).toBe('<td>1.230 s</td>');
});
it('number style should ignore string non-numeric values', () => {
const html = renderer.renderCell(1, 0, 'asd');
expect(html).toBe('<td>asd</td>');
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment