# Change number format for all elements of table

**URL:** <https://forum.inductiveautomation.com/t/change-number-format-for-all-elements-of-table/102722>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [February 22, 2025, 12:57am UTC](https://forum.inductiveautomation.com/t/change-number-format-for-all-elements-of-table/102722 "2025-02-22T00:57:59Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Simon\_Hathout\_Willar](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@Simon\_Hathout\_Willar](https://forum.inductiveautomation.com/u/Simon_Hathout_Willar)\
**Post date:** [February 22, 2025, 12:57am UTC](https://forum.inductiveautomation.com/t/change-number-format-for-all-elements-of-table/102722/1 "2025-02-22T00:57:59Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 22, 2025, 1:08am UTC](https://forum.inductiveautomation.com/t/change-number-format-for-all-elements-of-table/102722/2 "2025-02-22T01:08:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Simon\_Hathout\_Willar](https://avatars.discourse-cdn.com/v4/letter/s/3da27b/32.png) [@Simon\_Hathout\_Willar](https://forum.inductiveautomation.com/u/Simon_Hathout_Willar)\
**Post date:** [February 22, 2025, 1:21am UTC](https://forum.inductiveautomation.com/t/change-number-format-for-all-elements-of-table/102722/3 "2025-02-22T01:21:56Z")

</div>

Alright.

I was looking into using a script like

```python
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.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [February 22, 2025, 2:13am UTC](https://forum.inductiveautomation.com/t/change-number-format-for-all-elements-of-table/102722/4 "2025-02-22T02:13:45Z")

</div>

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:

> [@Automation Professionals' Integration Toolkit Module](https://forum.inductiveautomation.com/t/automation-professionals-integration-toolkit-module/74934/5):
>
> I have spent my holiday poking at this. Wanted to provide an efficient replacement for a common use of python transforms: Make a (Perspective) table that dynamically populates both .data and .columns from source dataset that isn't constrained to any particular structure or data types. In Vision, one can achieve this (mostly) by pre-populating the column attributes dataset with all of the possible column names your application might deliver. No such thing in Perspective. But a transform can …
