Quantcast
Channel: 🎛️ Dash - Plotly Community Forum
Viewing all articles
Browse latest Browse all 6271

Distinguishing 1.0 (float) as 1 (int) from dcc.Input

$
0
0

Hello everyone,

today I discovered that dcc.Input treats the float input 1.0 as the integer 1.

In the documentation there is this warning:

There is a limitation when converting numbers like 1.0 or 0.0, the corresponding number type in callbacks is Integer instead of Float . Please add extra guard casting like float() within callbacks if needed.

If I want to distinguish the input 1.0 and 1, how would I do it? I have Regex in mind, but wonder if there are any better solutions.

Thanks a bunch!

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 6271

Trending Articles