Skip to content
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

Ambiguity in is-numeric #75

Open
ndw opened this issue May 24, 2020 · 0 comments
Open

Ambiguity in is-numeric #75

ndw opened this issue May 24, 2020 · 0 comments

Comments

@ndw
Copy link

ndw commented May 24, 2020

The description of is-numeric reads:

Tests whether the given variables (Appendix IV - Variables) contain numeric content. Content is considered numeric if it solely consists of numbers. Numbers may have prefixes and suffixes (“D2”, “2b”, “L2d”), and may be separated by a comma, hyphen, or ampersand, with or without spaces (“2, 3”, “2-4”, “2 & 4”). For example, “2nd” tests “true” whereas “second” and “2nd edition” test “false”.

That doesn't clearly answer the question "when is a hyphen a separator and when is it part of a suffix?"

Consider "1234-abcd". If the hyphen is part of the suffix then that is numeric. If it isn't, then it's a separator in which case the test is against ("1234", "abcd") and since "abcd" isn't a number, it isn't numeric.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant