Sliders Significant Digits

Hello everyone,

I have implemented sliders in a Bokeh Server. Noticed the Slider values being shown are limited to two decimal places. Some parameters are really small so unable to see the values using sliders. Is there a way to specify the number of decimal places for current slider value?

From what I can gather from documentation that there is no attribute which i can set it. Am I missing something or is it not possible?

I have a workaround where I can multiply the parameter by 100 or 1000 so it is closer to order of 1 to resolve the issue. If there is a way to set the number of decimals in slider value that will be great.

Sliders Documentation

image

Thank you for your time.

In the slider documentation link you have its called “format”. Here is an example:

ParamSlider = Slider(title='L_COND_BULK(0.00137) ', start=0, value=0, end=0.001, step = 0.001, format = '0.000', width=50)

Ive also seen it as: format=‘0[.]0’ in a slider.

Or setting significant digits in a TableColumn:
TableColumn(field =‘x’, title = “distance (m)”, formatter=NumberFormatter(format=“0,0.0”))

1 Like

Thank you @Eric_Johnson . Clearly, I missed it in the documentation and it solves the issue I am having.