Bug 163587 - Make NUMBERVALUE function handle unicode minus
Summary: Make NUMBERVALUE function handle unicode minus
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
24.8.2.1 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-23 09:37 UTC by stau8y
Modified: 2024-11-18 17:23 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 stau8y 2024-10-23 09:37:42 UTC
Description:
Pasted numerical data sometimes use unicode minus 0x2212.
It would be nice if NUMBERVALUE supports that, in addition to the ASCII minus.


Steps to Reproduce:
1.Enter formula =NUMBERVALUE("−123") in a cell
2.
3.

Actual Results:
It fails with #VALUE!

Expected Results:
Number -123


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 24.8.2.1 (X86_64) / LibreOffice Community
Build ID: 0f794b6e29741098670a3b95d60478a65d05ef13
CPU threads: 20; OS: Windows 11 X86_64 (10.0 build 22631); UI render: Skia/Raster; VCL: win
Locale: sv-SE (sv_SE); UI: en-US
Calc: CL threaded
Comment 1 Nicole A. 2024-11-14 04:50:08 UTC Comment hidden (obsolete)
Comment 2 Nicole A. 2024-11-14 04:52:13 UTC Comment hidden (obsolete)
Comment 3 Nicole A. 2024-11-14 04:52:39 UTC
UX Team -- please take a look at this enhancement. Thanks!
Comment 4 Heiko Tietze 2024-11-14 09:11:30 UTC
In contrast or supplementary to the hyphen minus U+002D, the glyph U+2212 is the minus sign, see https://www.compart.com/en/unicode/U+2212.

I support this request, although it was rejected previously (in a wider context). 

(In reply to Eike Rathke from bug 125068 comment 8)
> We could add U+2212 MINUS SIGN to the lexical tokenizer for formula
> expressions and treat it like a U+002D HYPHEN-MINUS operator minus, whereas
> every output of the formula expression would display the U+002D HYPHEN-MINUS
> again.

+1 (cutting off the "Not much desirable for me." because not working everywhere)
Comment 5 V Stuart Foote 2024-11-14 16:38:27 UTC
(In reply to Heiko Tietze from comment #4)
> In contrast or supplementary to the hyphen minus U+002D, the glyph U+2212 is
> the minus sign, see https://www.compart.com/en/unicode/U+2212.
> 
> I support this request, although it was rejected previously (in a wider
> context). 
> 
> (In reply to Eike Rathke from bug 125068 comment 8)
> > We could add U+2212 MINUS SIGN to the lexical tokenizer for formula
> > expressions and treat it like a U+002D HYPHEN-MINUS operator minus, whereas
> > every output of the formula expression would display the U+002D HYPHEN-MINUS
> > again.
> 

No objection, but users will be annoyed that the internal HYPHEN-MINUS mapping will always result as an entry of the U+002d in their sheets and table cells, and not the typographic MINUS SIGN U+2212 they input.
Comment 6 Eike Rathke 2024-11-18 17:23:17 UTC
This goes astray as my comment was on bug 125068 about formula and general number input, and not this one here which is about the NUMBERVALUE() function that solely converts distinct text input.