dash-core-components
dash-core-components copied to clipboard
Formatting options for Input components
Various kinds of automatic formatting are common for input fields: thousands separators, parens & hyphens for phone numbers, various ID numbers with dashes interspersed, forcing uppercase or lowercase... would be nice to support these in Input components.
From https://community.plot.ly/t/thousand-separator-for-dcc-input/29563
I was just looking at this, but was stuck on converting the displayed/masked value back to what presumably you'd want for a callback, which is the "raw" value. The simplest way to do what that user is requesting in JS seems to be to use Intl.NumberFormat.
Also rounding numbers for display but keeping the raw value behind the scenes for callbacks & computations.
I am quite new to this, i studied "Adding CSS & JS and Overriding.." https://dash.plot.ly/external-resources
Could Intl.NumberFormat be used in a .js script that would override the dcc.Input display? If so could you provide a small example? Thanks in advance
Any updates if and when this might become a feature?
Not really on our roadmap but we’d happily help advance a PR if anyone is keen to contribute. Please note this repo is not used anymore, DCC is part of the Dash repo now.