Bug 111999 - Basic: VAL function Val("1, 2") return 12
Summary: Basic: VAL function Val("1, 2") return 12
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
3.5 all versions
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-08-24 07:47 UTC by raal
Modified: 2017-09-08 15:23 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
test file (7.99 KB, application/vnd.oasis.opendocument.spreadsheet)
2017-08-24 07:48 UTC, raal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description raal 2017-08-24 07:47:34 UTC
Description:
VAL function Val("1, 2") return 12

definition of function:
https://help.libreoffice.org/Basic/Val_Function_Runtime

tested LibreOffice 3.5.0 
Build ID: d6cde02
and 
Version: 6.0.0.0.alpha0+
Build ID: 0e35b7738d9f276c0566df0f2cc0f1eed7900d6c
CPU threads: 4; OS: Linux 4.4; UI render: default; VCL: gtk2; 
TinderBox: Linux-rpm_deb-x86_64@70-TDF, Branch:master, Time: 2017-08-22_01:24:19

Steps to Reproduce:
1.open attached file with macro
2.see result of function  Val("1, 2") 
3.

Actual Results:  
return 12

Expected Results:
return 1


Reproducible: Always

User Profile Reset: No

Additional Info:


User-Agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:55.0) Gecko/20100101 Firefox/55.0
Comment 1 raal 2017-08-24 07:48:21 UTC
Created attachment 135758 [details]
test file
Comment 2 Robert Großkopf 2017-08-24 18:20:43 UTC
A "," is a thousands separator for Basic, so it will be ignored. A "." is a decimal separator. So it will be changed to a decimalpoint. It will be shown in a msgbox with the decimalseparator of the language of the GUI.

Don't know if this could be called a bug, because
val("1,000") should be 1000.

It is the same behavior since the beginning of LO, also present in OOo 2.*
Comment 3 Buovjaga 2017-09-08 15:23:35 UTC
Comments from Noel G.:
that sounds like a locale dependent thing
where even if it __is__ wrong, and we change it, we will break stuff
so even a fix would need to hide behind some kind of strictmode flag

Let's close, then.