how to show integer, not float, with hover tooltip in bokeh how to show integer, not float, with hover tooltip in bokeh python python

how to show integer, not float, with hover tooltip in bokeh


Adding my two cents. I figured out by you can control the decimal points by using the following code:

hover.tooltips = [    ("Days", "@x{int}"), # this will show integer, even if x is float    ("Return", "@y{1.11}"), # this will format as 2-decimal float]

Hope this helps.


Aha! Using @ instead of $ works.

hover.tooltips = [    ("Days", "@x"),    ("Return", "@y"),]