Is there a way to format the
LEDDisplay() as scientific notation? My device returns small numbers like
8e-6. But the
LEDDisplay() only displays this as
0.0000008. I would prefer to display as
I don’t see a property to format it, is there something I am missing or is this just the incorrect component to use?
Unfortunately it doesn’t seem LEDDisplay supports that format, but you can get similar results filling a
html.Div component with numbers formatted using Python’s string formatting. Going from the
daq.LEDDisplay component example, you could do something like:
import dash_daq as daq
import dash_core_components as dcc
import dash_html_components as html
external_stylesheets = ['https://codepen.io/chriddyp/pen/bWLwgP.css']
app = dash.Dash(__name__, external_stylesheets=external_stylesheets)
app.layout = html.Div([
return '%6e' % (value/1e6)
if __name__ == '__main__':
Then it would just be a matter of styling the
html.Div with an LED-like font. There seem to be a few on the internet, but with various licenses so I wasn’t sure about posting them here.
Thanks so much for your detailed response nickest!