Bug 128122 - BASIC CCur function docs need to be corrected regarding locale settings
Summary: BASIC CCur function docs need to be corrected regarding locale settings
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Documentation (show other bugs)
Version:
(earliest affected)
6.2.7.1 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Macro-Documentation
  Show dependency treegraph
 
Reported: 2019-10-13 19:14 UTC by Johnny Rosenberg
Modified: 2020-06-20 17:22 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Johnny Rosenberg 2019-10-13 19:14:32 UTC
From LibreOffice Help:
”CCur Function
Converts a string expression or numeric expression to a currency expression. The locale settings are used for decimal separators and currency symbols.”

My locale is Swedish, so my currency is ”kr” and my decimal symbol is a comma.
Yet, the CCur function doesn't accept anything else than a decimal point and with no currency symbol at all:

Print CCur("75,50 kr") ⇨ Illegal value or data type. Wrong data type.
Print CCur("75.50 kr") ⇨ Illegal value or data type. Wrong data type.
Print CCur("75,50") ⇨ 7550.0000
Print CCur("75.50") ⇨ 75.5000

If I create a dialogue with a currency field in it, and enter 75, the result is ”75,00 kr”, which is correct for my locale.

So either the function doesn't work properly or the help text is wrong.
Comment 1 raal 2019-10-14 18:35:36 UTC
I can confirm with Version: 6.4.0.0.alpha0+
Build ID: 9b5dad13b56bdde7c40970351af3da3a2c3c9350
CPU threads: 4; OS: Linux 4.15; UI render: default; VCL: x11; 

use
print ccur(str("75,50"))
print ccur(cdbl("75,50"))

I don't think it's a bug, because ccur should be compatible with VBA (or it's VBA function).
Comment 2 Johnny Rosenberg 2019-10-14 19:24:56 UTC
So then the manual is wrong (”The locale settings are used for decimal separators and currency symbols”, but they are clearly not). Should I report that in a separate bug report for the documentation?
Comment 3 Buovjaga 2020-04-24 14:17:08 UTC
Let's repurpose this existing report