Bug 156449

Summary: Number format: scientific notation do not respect '?' (blank) in exponent
Product: LibreOffice Reporter: Laurent Balland <jumbo4444>
Component: CalcAssignee: Laurent Balland <jumbo4444>
Status: RESOLVED FIXED    
Severity: normal CC: stephane.guillou
Priority: medium    
Version: Inherited From OOo   
Hardware: All   
OS: All   
See Also: https://bugs.documentfoundation.org/show_bug.cgi?id=118324
Whiteboard: target:24.2.0
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 107575    

Description Laurent Balland 2023-07-24 19:01:19 UTC
Description:
A number format like "0.00E+?0" should display PI() like "3.14E+ 0", as '?' should be replace by a blank if exponent is less than 10. But Calc treats '?' as a '0' and display "3.14E+00".

Steps to Reproduce:
1. In Calc, Format > Cells > Numbers
2. Set Format code to 0.00E+?0
3. Display a value between 1e-9 and 1e10, like PI(), to have only 1 digit in exponent

Actual Results:
Value displayed is 3.14E+00, which corresponds to Format code 0.00E+00

Expected Results:
Value should be displayed as 3.14E+ 0 with a blank instead of the first '0'


Reproducible: Always


User Profile Reset: No

Additional Info:
Excel correctly treats this format code.
Comment 1 Stéphane Guillou (stragu) 2023-07-25 08:15:32 UTC
Reproduced in:

Version: 24.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 94caaf5c9e2917a3202cf515d61eaa9399b2c2b5
CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: threaded

And OOo 3.3.
Comment 2 Commit Notification 2023-11-01 10:44:29 UTC
Laurent Balland committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/443027cd71aef3eb45bbf3631869ea63457f2c81

tdf#156449 Preserve '0' or '?' in exponent

It will be available in 24.2.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.