Bug 149569 - Spreadsheet refuses to use the correct number of decimal places
Summary: Spreadsheet refuses to use the correct number of decimal places
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.3.4.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-14 21:09 UTC by Jeff9Man
Modified: 2022-06-15 18:41 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Sample file working OK (10.87 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-06-15 15:07 UTC, Rafael Lima
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jeff9Man 2022-06-14 21:09:36 UTC
Description:
Formatting Error

Spreadsheet formula: =(A3+BC)/C3
A3: $25,000.00 (Cell format: currency with 2 decimal places)
B3: $66,667.00 (Cell format: currency with 2 decimal places)
C3: 33.3% (Cell format: percent with 1 decimal place)
Result: 275,001

(25,000+66,667)/33.3% SHOULD equal 275,276

275,001 is the result of (25,000+66,667)/33.3333%

I have manually set the number of decimal places to 1 when cell C3 is formatted as a percent.
I have manually set the number of decimal places to 3 when cell C3 is formatted as a number.
I have manually set the number of decimal places for cells A3 and B3 to 0 when formatted as currency AND as a number.

Nothing I can do will get cell C3 to recognize 33.3% or 0.333 correctly. 

Steps to Reproduce:
Spreadsheet formula: =(A3+BC)/C3
A3: $25,000.00 (Cell format: currency with 2 decimal places)
B3: $66,667.00 (Cell format: currency with 2 decimal places)
C3: 33.3% (Cell format: percent with 1 decimal place)

Actual Results:

275,001

Expected Results:
275,276


Reproducible: Always


User Profile Reset: No



Additional Info:
Divided the sum of 25,000 and 66,667 by 0.333
Comment 1 m_a_riosv 2022-06-15 00:53:37 UTC
The result, it's fine for me.
Please attach your sample file, to test.
Comment 2 Rafael Lima 2022-06-15 15:07:39 UTC
Created attachment 180788 [details]
Sample file working OK

Not repro

Version: 7.3.3.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 16; OS: Linux 5.13; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Ubuntu package version: 1:7.3.3~rc2-0ubuntu0.21.10.1~lo1
Calc: threaded

Also not repro in

Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: 66b849eab05bb6b696cced84ca90c17ca1bc31dd
CPU threads: 16; OS: Linux 5.13; UI render: default; VCL: kf5 (cairo+xcb)
Locale: pt-BR (pt_BR.UTF-8); UI: en-US
Calc: CL

I attached a file reproducing the steps described by the OP and the result seems fine.

Please attach your own sample file so we can test.
Comment 3 LeroyG 2022-06-15 18:39:04 UTC
You have entered the value in C3 with a formula similar to =1/3, and it gets many 3 as decimal places, although it shows only one.
Just type 33.3, and you will get 275276.
Comment 4 LeroyG 2022-06-15 18:41:52 UTC
Maybe you must check [x] Precision as shown (https://help.libreoffice.org/latest/en-US/text/shared/optionen/01060500.html#hd_id3145150).