Change number format for all elements of table

Hello.

I have a table with 20 columns. Many of these columns are doubles, which are quite small (1 * 10^-4). The default perspective number formatting just shows these as 0, but this isn't desirable.

Changing the number format on these fields to exponential makes it much easier to read them. However, doing this column by column is tedious.

Is there a way to apply a bulk number format to each element in the table, perhaps a property I've missed?

No, but you could programmatically generate your props.columns with a binding.

Alright.

I was looking into using a script like

def get_column_formatting(headers)
	columnFormattings = []
	for header in headers :
		columnFormat = '''
		{
		  "field": "{headerName}",
		  "visible": true,
		  "editable": false,
		  "render": "auto",
		  (and a bunch more properties)
		}'''.format(headerName = header)
		columnFormattings.append(columnFormat)
	return columnFormattings

But I was getting some issues related to newline weirdness. I will investigate this further next week.

I think the ultimate question is who in the world is viewing a table with 30 columns and why -- that should help guide my choices.

If you are starting with a convential dataset (NQ or historian), it is best to bring that binding to a view custom property, keeping dataset format. Then you can bind props.data to convert the data to JSON, and simultaneously bind props.columns use the ordered column information (name and data type).

Some example code here, even if you don't use my toolkit: