Include space before SI-prefix
In the SI system, prefix and units should be written after a space (see e.g.: https://en.wikipedia.org/wiki/International_System_of_Units#General_rules) I haven't found an option to do this. The issue can be reproduced by the example below where I get a space between the prefix (e.g. k) and the unit W. Alternatively I could of course skip the space before the W, but I cannot find a way to add a space between the last digit and the SI-prefix.
import dash
import dash_table
import pandas as pd
df = pd.read_csv('https://raw.githubusercontent.com/plotly/datasets/master/solar.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)

(I responded to your community forum post about this here: https://community.plot.ly/t/dash-table-numeric-formatting-symbol-use/35784/3)
(response was given in the community post)
Hi, @chriddyp could it be that this issue is inherited from d3's format? From what I can see, d3 also writes without a whitespace.
Another bug I have discovered regarding the number formatting: If the if "prefix" is set together with "locale": "symbol": ['a', 'b'], the last element 'b' of the "symbol" list is written before the prefix, while if "prefix" is not set, 'b' is written after the prefix (this behavior is the most useful for units). Also a bit annoying that defining "prefix" switches from significant digits to number of decimals, but this seems intended, so not a bug.
examples:
1000 with 'format': {'locale': {'symbol': ['', 'W']}, 'nully': '', 'prefix': 10**3, 'specifier': '$.3s'} is written as 1.000Wk
1000 with 'format': {'locale': {'symbol': ['', 'W']}, 'nully': '', 'specifier': '$.3s'} is written as 1.00kW
As mentioned: Ideally I would like to write e.g. 1.00 kW
Just in case: it wasn't working for me until I added the 'type': 'numeric', might be obvious to some, but turns out this isn't optional.
@asnyv I'm surprised this issue didn't get more attention! Maybe SI is still unknown to many. :joy:
Did you find a workaround since you posted? :blush:
@Peque No, I haven't 🙄 Ended up writing the unit in the column headers (e.g. W) and living with the e.g. 1.3M for the table values...
But yes, I'm a bit surprised myself 😅 Would also have been nice to be able to set SI as the overall standard format for an app. Annoying with e.g. B popping up instead of G for 1e9 if you haven't remembered to specify the SI syntax.
For future reference, just in case I get an answer there, here is a question I posted in SO about this topic.