Bug 129460 - concat function ignores decimal point display
Summary: concat function ignores decimal point display
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.4.0.0.beta1+
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: gyrlgith
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-18 01:31 UTC by gyrlgith
Modified: 2019-12-28 06:46 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
decimate point no change (7.20 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-12-18 01:31 UTC, gyrlgith
Details
Sample file with TEXT() function in. (9.11 KB, application/vnd.oasis.opendocument.spreadsheet)
2019-12-22 18:09 UTC, m_a_riosv
Details
Text function "0" sets referrer number to 0 (44 bytes, text/plain)
2019-12-25 17:13 UTC, gyrlgith
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gyrlgith 2019-12-18 01:31:04 UTC
Description:
10/3=3.3333333...
This is not a mistake.
The problem is cell style> default> number> number of decimals = 0
Even with this setting, the concat function displays all the decimal points of the referenced cell. I can't fix it by ignoring the cell style.
This is a very disturbing bug.


Steps to Reproduce:
1.A2 input > 10/3 >A2 view 3.3333..
2.cell style > default > number > decimal points 0
3.concat input B1 to =A2
3.decimal points not 0. you cant setting 0 or other.

Actual Results:
write > steps to Reproduce

Expected Results:
3.decimal points not 0. you cant setting 0 or other.


Reproducible: Always


User Profile Reset: Yes



Additional Info:
concat function cell. view decimal points settings 0.
Comment 1 gyrlgith 2019-12-18 01:31:58 UTC
Created attachment 156640 [details]
decimate point no change
Comment 2 m_a_riosv 2019-12-18 07:29:11 UTC
Cell format doesn't change ceel value, so references to the cell retrieve the true value not the formatted value.

Use a formula like =CONCAT(TEXT(I10;"0")).
BTW you can use the operator '&' to concatenate texts ="a"&"b"
Comment 3 gyrlgith 2019-12-22 14:43:53 UTC
Thanks for telling me &.
Probably faster than using concat, probably.
And the text function doesn't fix this.
That would make all the numbers "0" and have no meaningful result.
Comment 4 m_a_riosv 2019-12-22 18:08:09 UTC
(In reply to gyrlgith from comment #3)
> Thanks for telling me &.
> Probably faster than using concat, probably.
> And the text function doesn't fix this.
> That would make all the numbers "0" and have no meaningful result.
Have you tested? TEXT(I10;"0"), gives a text with zero decimals no matter how many it has.

The function can use the same formats than a cell uses.
https://help.libreoffice.org/6.3/en-US/text/scalc/01/04060110.html?DbPAR=CALC#bm_id3147132
https://help.libreoffice.org/6.3/en-US/text/shared/01/05020301.html?&DbPAR=CALC&System=WIN
Please take a quick review of calc documentation 
https://documentation.libreoffice.org/en/english-documentation/
it helps a lot to know what can be done and how.
Comment 5 m_a_riosv 2019-12-22 18:09:16 UTC
Created attachment 156733 [details]
Sample file with TEXT() function in.

See your file with the TEXT() function in.
Comment 6 gyrlgith 2019-12-25 17:13:48 UTC
Created attachment 156779 [details]
Text function "0" sets referrer number to 0

We could reproduce the bug.
Take a look at sheet 2 with the attached file. The number that should be 23 will be 0 by the text function
This happens when the referrer uses concat or sum. Some combinations do not occur, but it is unclear why they do.
Of course I updated to 6.2.3.8 and deleted the configuration file before checking.
Older versions would be wrong to report bugs.
But even the latest version had bugs. What do you think?
Does this not happen in beta version etc?
Comment 7 gyrlgith 2019-12-25 17:18:55 UTC
(In reply to m.a.riosv from comment #4)
> Have you tested? TEXT(I10;"0"), gives a text with zero decimals no matter
> how many it has.

Yeah, I tested and saved it and closed the file that day thinking I was able to hide the decimal point.
However, the next day, when I opened the file, the number was 0.
I've been working on creating a bug reproduction file in the last few days. The bug has been reproduced!
Comment 8 m_a_riosv 2019-12-26 11:42:03 UTC
(In reply to gyrlgith from comment #6)
> Created attachment 156779 [details]
> Text function "0" sets referrer number to 0

No spreadseet file attached.
Comment 9 Mike Kaganski 2019-12-28 06:46:50 UTC
(In reply to gyrlgith from comment #6)

As @m.a.riosv told you, your attachment 156779 [details] is likely the wrong one: it's neither a spreadsheet, nor even a screenshot: it's just a plain text "Text function "0" sets referrer number to 0", which is plain wrong statement: function TEXT is used to format value into string (see first link in comment 4), not change its value; and its second argument is just a format string, not a value. I suppose you have made a mistake using the function.

On the other side, the original question here is not a bug; as mentioned in comment 2, the behaviour that cell formatting is not taken into account when you concatenate cell's value into a string is expected and correct.

Resolving NOTABUG; for questions regarding "how to use Calc correctly", please ask a question on https://ask.libreoffice.org.