question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Include space before SI-prefix

See original GitHub issue

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)

image

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Pequecommented, Nov 15, 2021

For future reference, just in case I get an answer there, here is a question I posted in SO about this topic.

1reaction
asnyvcommented, Nov 15, 2021

@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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SI Unit rules and style conventions checklist
There is a space between the numerical value and unit symbol, even when the value is used in an adjectival sense, except in...
Read more >
Punctuation with units - English StackExchange
The numerical value always precedes the unit, and a space is always used to separate the unit from the number. (…) The only...
Read more >
SI Unit rules and style conventions
SI Unit rules and style conventions. An object and any quantity describing the object are distinguished. (Note the difference between "surface" and "area,"....
Read more >
No space after number for metric units? - Customer Support
"The International System of Units (SI) recommends inserting a space between a number and a unit of measurement units and between units in ......
Read more >
How to Use SI Units in Technical Writing - AJE
These symbols are not abbreviations, so periods are not required. Additionally, a space should always be included between a number and the SI...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found