-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Warn user about bad number_input format string #800
Comments
I think the right behavior is to throw an error rather than cleaning up the input. |
This is in the number_input react component -- currently, we're silently not-failing on whatever format weirdness may be afoot.
|
Discussion point: we say we support a printf interface for formatting, but we honestly don't. From
Here are all the characters printf supports. Stuff we don't support:
SUGGESTION... Maybe our documentation should list off the formatting characters we DO support, and support those explicitly. (It's a very finite list!) |
This code:
results in the NumberInput not showing any value. "a%.3f" is a valid format string, but it translates, e.g., a value of
0
into the stringa0.000
, which is not displayable by the NumberInput, which is restricted to numeric characters only.We should probably detect this on the Python side (and warn the user) and/or clean up the format string (or resultant output) such that non-displayable characters won't result in nothing being displayed.
The text was updated successfully, but these errors were encountered: