You are viewing a plain text version of this content. The canonical link for it is here.
Posted to qa@openoffice.apache.org by Czesław Wolański <cz...@gmail.com> on 2022/06/16 10:58:04 UTC

Value returned by CInt("+1")

Hi,

The problem was reported yesterday on the English forum: topic "CINT("+1")
returns 0".
https://forum.openoffice.org/en/forum/viewtopic.php?p=525249&sid=0481325a63f94adf45c49ba4175701d7#p525249

In version 4.1.12,   CLng("+1") returns 0 too.

I haven't found any relevant report in Bugzilla. Do you think this problem
is "Bugzilla-worthy"?


Kind regards,
Czesław

Re: Value returned by CInt("+1")

Posted by Matthias Seidel <ma...@hamburg.de>.
Hi Czesław,

Am 16.06.22 um 12:58 schrieb Czesław Wolański:
> Hi,
>
> The problem was reported yesterday on the English forum: topic "CINT("+1")
> returns 0".
> https://forum.openoffice.org/en/forum/viewtopic.php?p=525249&sid=0481325a63f94adf45c49ba4175701d7#p525249
>
> In version 4.1.12,   CLng("+1") returns 0 too.
>
> I haven't found any relevant report in Bugzilla. Do you think this problem
> is "Bugzilla-worthy"?

I think it is...

Regards,

   Matthias

>
>
> Kind regards,
> Czesław
>


Re: Value returned by CInt("+1")

Posted by Czesław Wolański <cz...@gmail.com>.
Hi Carl,

I never made a build on my own.
As there are no builds for Windows available, yesterday I tested the issue
on Matthias' builds: 4.1.13 and 4.2.
Both functions return 0 in both builds.

Regards,
Czesław

Le ven. 17 juin 2022 à 12:43, Carl Marcum <cm...@apache.org> a écrit :

> Hi Czesław,
>
> On 6/16/22 6:58 AM, Czesław Wolański wrote:
> > Hi,
> >
> > The problem was reported yesterday on the English forum: topic
> "CINT("+1")
> > returns 0".
> >
> https://forum.openoffice.org/en/forum/viewtopic.php?p=525249&sid=0481325a63f94adf45c49ba4175701d7#p525249
> >
> > In version 4.1.12,   CLng("+1") returns 0 too.
> >
> > I haven't found any relevant report in Bugzilla. Do you think this
> problem
> > is "Bugzilla-worthy"?
> >
> >
> > Kind regards,
> > Czesław
> >
>
> Can you test this in a build of trunk and AOO41X?
> If not I can this evening.
>
> I've recently found things like this fixed in trunk many years ago but
> not backported into AOO41X.
> One involved CLng that has recently been added.
>
> Thanks,
> Carl
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: qa-help@openoffice.apache.org
>
>

Re: Value returned by CInt("+1")

Posted by Carl Marcum <cm...@apache.org>.
Hi Czesław,

On 6/16/22 6:58 AM, Czesław Wolański wrote:
> Hi,
>
> The problem was reported yesterday on the English forum: topic "CINT("+1")
> returns 0".
> https://forum.openoffice.org/en/forum/viewtopic.php?p=525249&sid=0481325a63f94adf45c49ba4175701d7#p525249
>
> In version 4.1.12,   CLng("+1") returns 0 too.
>
> I haven't found any relevant report in Bugzilla. Do you think this problem
> is "Bugzilla-worthy"?
>
>
> Kind regards,
> Czesław
>

Can you test this in a build of trunk and AOO41X?
If not I can this evening.

I've recently found things like this fixed in trunk many years ago but 
not backported into AOO41X.
One involved CLng that has recently been added.

Thanks,
Carl


---------------------------------------------------------------------
To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
For additional commands, e-mail: qa-help@openoffice.apache.org


RE: Value returned by CInt("+1")

Posted by de...@acm.org.
Excel has it so there has to be a solution in AOO Calc.  And indeed there is.

It is in the built-in Help under Number Format Codes.  Here is a conventional 
sign everything and show 0's format code for currency values (without any $) 
that I use in some investment tracking.

 +#,##0.00;-#,##0.00;; 0.00

-----Original Message-----
From: Carl Marcum <cm...@apache.org>
Sent: Saturday, June 18, 2022 08:49
To: qa@openoffice.apache.org
Subject: Re: Value returned by CInt("+1")

[orcmid] [ ... ]

If I enter +1 into a cell my default number format changes it to a 1.
I haven't found any number format options where positive values have a leading 
+ but I haven't checked them all.

[orcmid] [ ... ]


---------------------------------------------------------------------
To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
For additional commands, e-mail: qa-help@openoffice.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
For additional commands, e-mail: qa-help@openoffice.apache.org


Re: Value returned by CInt("+1")

Posted by Czesław Wolański <cz...@gmail.com>.
Hi Carl, all

Thank you for your insight. A few observations on my part:
(1) isNumeric("+1") returns False
(2)  for "+1" argument: CInt() and CLng() produce 0, CDec() gives 1 whereas
CSng() and CDbl() - an error "Inadmissible value or data type. Data type
mismatch"
(3) the help text you quoted is in description of the above functions;
except for CDec()

All in all, I agree that both the bug and the enhancement need to be
considered.

Best regards,
Czesław

Le sam. 18 juin 2022 à 19:39, <de...@acm.org> a écrit :

> Sorry, it is
>
> +#,##0.00;-#,##0.00;0.00
>
> (stray ";" below)
>
> -----Original Message-----
> From: dennis.hamilton@acm.org <de...@acm.org>
> Sent: Saturday, June 18, 2022 10:37
> To: 'qa@openoffice.apache.org' <qa...@openoffice.apache.org>
> Subject: RE: Value returned by CInt("+1")
>
> Excel has it so there has to be a solution in AOO Calc.  And indeed there
> is.
>
> It is in the built-in Help under Number Format Codes.  Here is a
> conventional
> sign everything and show 0's format code for currency values (without any
> $)
> that I use in some investment tracking.
>
>  +#,##0.00;-#,##0.00;; 0.00
>
> -----Original Message-----
> From: Carl Marcum <cm...@apache.org>
> Sent: Saturday, June 18, 2022 08:49
> To: qa@openoffice.apache.org
> Subject: Re: Value returned by CInt("+1")
>
> [orcmid] [ ... ]
>
> If I enter +1 into a cell my default number format changes it to a 1.
> I haven't found any number format options where positive values have a
> leading
> + but I haven't checked them all.
>
> [orcmid] [ ... ]
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: qa-help@openoffice.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: qa-help@openoffice.apache.org
>
>

RE: Value returned by CInt("+1")

Posted by de...@acm.org.
Sorry, it is

+#,##0.00;-#,##0.00;0.00

(stray ";" below)

-----Original Message-----
From: dennis.hamilton@acm.org <de...@acm.org>
Sent: Saturday, June 18, 2022 10:37
To: 'qa@openoffice.apache.org' <qa...@openoffice.apache.org>
Subject: RE: Value returned by CInt("+1")

Excel has it so there has to be a solution in AOO Calc.  And indeed there is.

It is in the built-in Help under Number Format Codes.  Here is a conventional 
sign everything and show 0's format code for currency values (without any $) 
that I use in some investment tracking.

 +#,##0.00;-#,##0.00;; 0.00

-----Original Message-----
From: Carl Marcum <cm...@apache.org>
Sent: Saturday, June 18, 2022 08:49
To: qa@openoffice.apache.org
Subject: Re: Value returned by CInt("+1")

[orcmid] [ ... ]

If I enter +1 into a cell my default number format changes it to a 1.
I haven't found any number format options where positive values have a leading 
+ but I haven't checked them all.

[orcmid] [ ... ]


---------------------------------------------------------------------
To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
For additional commands, e-mail: qa-help@openoffice.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
For additional commands, e-mail: qa-help@openoffice.apache.org


Re: Value returned by CInt("+1")

Posted by Carl Marcum <cm...@apache.org>.
Hi Czesław,

On 6/23/22 11:18 AM, Czesław Wolański wrote:
> Hi all,
>   
> Bugzilla issue 128518 - Basic - Converting "+1" to a number
> https://bz.apache.org/ooo/show_bug.cgi?id=128518
>
> Regards,
> Czesław
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: qa-help@openoffice.apache.org
>
Thanks for entering it in bz.

Best regards,
Carl

---------------------------------------------------------------------
To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
For additional commands, e-mail: qa-help@openoffice.apache.org


Re: Value returned by CInt("+1")

Posted by Czesław Wolański <cw...@apache.org>.
Hi all,
 
Bugzilla issue 128518 - Basic - Converting "+1" to a number
https://bz.apache.org/ooo/show_bug.cgi?id=128518

Regards,
Czesław

---------------------------------------------------------------------
To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
For additional commands, e-mail: qa-help@openoffice.apache.org


Re: Value returned by CInt("+1")

Posted by Czesław Wolański <cw...@apache.org>.
Hi,

Le lun. 27 juin 2022 à 09:18, Lucien Mathay a écrit :
>
> Yes, in Excel 2003, both CInt, CLng, CDec, CSng and CDbl
> return 1 if the argument is "+1"
> 

Thanks for checking it out, Lucien.

Best regards,
Czesław

---------------------------------------------------------------------
To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
For additional commands, e-mail: qa-help@openoffice.apache.org


Re: Value returned by CInt("+1")

Posted by Lucien Mathay <MA...@live.fr>.
Hi,

Le 19/06/22 à 10:41, Czesław Wolański a écrit :
> In LibreOffice 7.2.7 each of the functions: CInt, CLng, CDec, CSng and CDbl returns 1 if the argument is "+1". Same outcome on a VBA version Excel 2010.
>
> If I may ask: Does it also happen with Excel 2003?
Yes, in Excel 2003, both CInt, CLng, CDec, CSng and CDbl   return 1 if 
the argument is "+1"

Best regards,
Lucien

Re: Value returned by CInt("+1")

Posted by Czesław Wolański <cw...@apache.org>.
Hi Lucien,

On 2022/06/18 20:34:56 Lucien Mathay wrote:
>
> When tested on a VBA version Excel 2003,      CLng("+1") returns 1
> 

In LibreOffice 7.2.7 each of the functions: CInt, CLng, CDec, CSng and CDbl returns 1 if the argument is "+1". Same outcome on a VBA version Excel 2010.

If I may ask: Does it also happen with Excel 2003? 


Best regards,
Czesław

---------------------------------------------------------------------
To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
For additional commands, e-mail: qa-help@openoffice.apache.org


Re: Value returned by CInt("+1")

Posted by Lucien Mathay <MA...@live.fr>.
Hi Carl,

Le 18/06/22 à 17:49, Carl Marcum a écrit :
> I see that VBA does handle this now. I don't know if that was always 
> the case.

When tested on a VBA version Excel 2003,      CLng("+1") returns 1

Best regards,
Lucien
>
> Hi Czesław,
>
> On 6/16/22 6:58 AM, Czesław Wolański wrote:
>> Hi,
>>
>> The problem was reported yesterday on the English forum: topic 
>> "CINT("+1")
>> returns 0".
>> https://forum.openoffice.org/en/forum/viewtopic.php?p=525249&sid=0481325a63f94adf45c49ba4175701d7#p525249 
>>
>>
>> In version 4.1.12,   CLng("+1") returns 0 too.
>>
>> I haven't found any relevant report in Bugzilla. Do you think this 
>> problem
>> is "Bugzilla-worthy"?
>>
>>
>> Kind regards,
>> Czesław
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: qa-help@openoffice.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
For additional commands, e-mail: qa-help@openoffice.apache.org


Re: Value returned by CInt("+1")

Posted by Carl Marcum <cm...@apache.org>.
Hi Czesław,

On 6/16/22 6:58 AM, Czesław Wolański wrote:
> Hi,
>
> The problem was reported yesterday on the English forum: topic "CINT("+1")
> returns 0".
> https://forum.openoffice.org/en/forum/viewtopic.php?p=525249&sid=0481325a63f94adf45c49ba4175701d7#p525249
>
> In version 4.1.12,   CLng("+1") returns 0 too.
>
> I haven't found any relevant report in Bugzilla. Do you think this problem
> is "Bugzilla-worthy"?
>
>
> Kind regards,
> Czesław
>

If anything I think the bug is that it doesn't throw a runtime exception 
and returns an unexpected value.
Not that it doesn't accept the + when used with a string like "+1".

I see that VBA does handle this now. I don't know if that was always the 
case.

The help text states"
"... To convert a string expression, the number must be entered as 
normal text ("123.5") using the default number format of your operating 
system."

If I enter +1 into a cell my default number format changes it to a 1.
I haven't found any number format options where positive values have a 
leading + but I haven't checked them all.

Beside the bug for the runtime exception there could be an enhancement 
request to handle the + leading the string value since VBA and LO have 
added it.

Just my opinion.

Best regards,
Carl


---------------------------------------------------------------------
To unsubscribe, e-mail: qa-unsubscribe@openoffice.apache.org
For additional commands, e-mail: qa-help@openoffice.apache.org