# Dash\_table numeric formatting "symbol" use

**URL:** <https://community.plotly.com/t/dash-table-numeric-formatting-symbol-use/35784>\
**Category:** Dash Python\
**Created:** [March 4, 2020, 8:22am UTC](https://community.plotly.com/t/dash-table-numeric-formatting-symbol-use/35784 "2020-03-04T08:22:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![asgeirn](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@asgeirn](https://community.plotly.com/u/asgeirn)\
**Post date:** [March 4, 2020, 8:22am UTC](https://community.plotly.com/t/dash-table-numeric-formatting-symbol-use/35784/1 "2020-03-04T08:22:21Z")

</div>

Hi,  
I’m trying to format my table columns so that they are written with units in the cells. I have made an example from the [quickstart example in the tutorial](https://dash.plot.ly/datatable), only that I’ve made a new csv file where e.g. 100 MW is stored as 100000000 to let the data\_table format option take care of the SI-prefix. As far as I understand the documentation, I should be able to add a W at the end by adding `"locale": {"symbol": ["", "W"]}` to the `"format"` dict, but it doesn’t seem to work. See code below. Also, when adding SI-prefix to the number formatting, I would like to be able to have a space before the e.g. M for 1e6, but I haven’t found a way to do that? (as a number with SI-units should be written e.g. 1 MW and not 1MW).

```auto
import dash
import dash_table
import pandas as pd

df = pd.read_csv("./solar_plant_data.csv")

app = dash.Dash( __name__ )

app.layout = dash_table.DataTable(
    id='table',
    columns=[{"name": i, "id": i, "type": "numeric", "format": {'locale': {'symbol': ['', 'W']}, 'specifier': '.3s'}} for i in df.columns],
    data=df.to_dict('records'),
)

if __name__ == ' __main__':
    app.run_server(debug=True)

```

---

<div class="post-metadata">

**Author:** ![asgeirn](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@asgeirn](https://community.plotly.com/u/asgeirn)\
**Post date:** [March 5, 2020, 1:00pm UTC](https://community.plotly.com/t/dash-table-numeric-formatting-symbol-use/35784/2 "2020-03-05T13:00:33Z")

</div>

Found that I had to write ‘$.3s’ in the specifier to write the unit, but I still cannot make a space before the SI-prefix, and it seems like it is not implemented. Made an issue: [https://github.com/plotly/dash-table/issues/714](https://github.com/plotly/dash-table/issues/714)

---

<div class="post-metadata">

**Author:** ![chriddyp](https://sea2.discourse-cdn.com/flex024/user_avatar/community.plotly.com/chriddyp/32/16855_2.png) [@chriddyp](https://community.plotly.com/u/chriddyp)\
**Post date:** [March 5, 2020, 1:14pm UTC](https://community.plotly.com/t/dash-table-numeric-formatting-symbol-use/35784/3 "2020-03-05T13:14:58Z")

</div>

Does `'symbol': ['', ' W']` work?

---

<div class="post-metadata">

**Author:** ![asgeirn](https://avatars.discourse-cdn.com/v4/letter/a/0ea827/32.png) [@asgeirn](https://community.plotly.com/u/asgeirn)\
**Post date:** [March 5, 2020, 2:24pm UTC](https://community.plotly.com/t/dash-table-numeric-formatting-symbol-use/35784/4 "2020-03-05T14:24:22Z")

</div>

No, if you look at the github issue, I tried to do that. You get a space between the prefix and the unit, not between the unit and the prefix. There is a picture of it in the issue where you see a space between k and W
