-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Back to what it was pre #1078 on
['2 2', 22], | ||
['2%2', 22], | ||
['2$2', 22], | ||
['1,690,000', 1690000] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we add one for '$5,162,000.00'
to 5162000
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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