- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Notify Moderator
Fix isnumber() or provide a function which does what I would expect with that name
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Notify Moderator
The function isnumber(<arg>) (in formula-like tools) does not do what I would expect from it:
It returns whether the data format of the argument is numeric. It does not return whether the argument actually represents a number (even though it might be a string).
Currently, you would have to help yourself by something like
REGEX_Match(<arg>, "^[+-±]?\d*([.,]+\d*)?([eE][+-]?\d+)?$")
which is quite clumpsy.
From my perspective, the right setup would have been:
- isnumber(<arg>) returns whether the argument is a number (even if it might be of type string)
- isnumeric(<arg>) returns whether the argument is of a numeric data type
I understand if the functionality of isnumber(<arg>) needs to be preserved. Then, a new function could be called isfloat(<arg>): "Is the argument something which could be converted to a float?" That would still be misleading but better than nothing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.