https://bugs.documentfoundation.org/show_bug.cgi?id=123158

Mike Kaganski <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|WORKSFORME                  |NOTABUG

--- Comment #17 from Mike Kaganski <[email protected]> ---
(In reply to Leos Pohl from comment #8)
> (locale decimal separator is ",")
> 
> IsNumeric(1,2) = True
> IsNumeric(1.2) = True
> IsNumeric("1.2") = False
> IsNumeric("1,2") = True

(In reply to eisa01 from comment #14)
> Created attachment 186081 [details]

(In reply to eisa01 from comment #15)
> Seems to work now?

First of all, let us not mix things and do the nonsensical testing.

1. IsNumeric(1,2) = True

This is an own bug, unrelated to this. The IsNumeric *here* is called with
*two* parameters, while it accepts only a single argument. Leos Pohl and eisa01
likely confused the (1,2) syntax for an alternative floating-point notation
using comma - but it's not: it's the same as IsNumeric(1, 2) (note the space
between the two arguments, which is simply missing in the confusing sample).
The bug is that functions must throw an error when the caller passes more
arguments than allowed. The resulting "True" is for the integer 1 that is
passed as the first parameter - in is indeed numeric.

2. IsNumeric(1.2) = True

This is a correct check is a floating-point number is numeric. The only correct
way of writing floating-point number literals in Basic is using decimal dot.

3. IsNumeric("1.2")
   IsNumeric("1,2")

This is the whole essence of the issue discussed here. And it definitely
depends on the *locale* (as explained in comment 10), and so, when you test it
using a different locale, it doesn't tell you anything about reproducibility of
the original problem. Namely, the initial report used a locale with decimal
comma, and the test in comment 14 used a locale with decimal dot (and comma for
thousand separator). In Basic, the thousand separator can appear at any place,
not only separating groups of three digits -> hence the "1,2" is considered an
integer "12" with a thousand separator in unusual place. And "1.2" is
considered numeric, because it naturally matches the locale's floating-point
notation.

(In reply to Xisco FaulĂ­ from comment #16)
> > IsNumeric(" ") returns True
> @Mike, should it be reported as a separated bug ?

Yes, indeed.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to