Fix regression in lib/clean_number#1184
Conversation
- junk in the 'middle' of numeric string is again accepted
| var FRONTJUNK = /^['"%,$#\s']+/; | ||
| var ENDJUNK = /['"%,$#\s']+$/; | ||
| // precompile for speed | ||
| var JUNK = /['"%,$#\s]/g; |
There was a problem hiding this comment.
Back to what it was pre #1078 on
https://github.com/plotly/plotly.js/pull/1078/files#diff-9664b6a57e7771275ffd0c8805ea5917L30
| ['2 2', 22], | ||
| ['2%2', 22], | ||
| ['2$2', 22], | ||
| ['1,690,000', 1690000] |
There was a problem hiding this comment.
could we add one for '$5,162,000.00' to 5162000?
There was a problem hiding this comment.
Also: " $1,410,000.00 " to 1410000?
| ['2 2', 22], | ||
| ['2%2', 22], | ||
| ['2$2', 22], | ||
| ['1,690,000', 1690000] |
There was a problem hiding this comment.
You're right that this is what we had before - which is exactly why I changed it, though obviously I forgot about commas in the middle! I really think we should consider interpreting '2 2', '2%2', '2$2' etc as numbers to be bugs we should fix, unless someone can show me a legitimate use case for them to be interpreted as 22.
There was a problem hiding this comment.
What about '1 000 000' ?
|
Since we're reverting this to buy us some time... lets do this right. Can we do: |
|
Closed in favour of #1185 |
fixes #1183
cc @alexcjohnson @chriddyp