Bug 98020 (AutoChangeToBoolean) - The number format changes by itself to boolean
Summary: The number format changes by itself to boolean
Status: RESOLVED NOTABUG
Alias: AutoChangeToBoolean
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.1.0.3 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-02-20 11:24 UTC by Lorenz25
Modified: 2016-02-27 08:29 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Bug-NumberFormatChanges (9.36 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-02-20 11:24 UTC, Lorenz25
Details
Sample file modifying 'Match' style (9.23 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-02-25 10:57 UTC, m_a_riosv
Details
Two different formats in one style (9.94 KB, application/vnd.oasis.opendocument.spreadsheet)
2016-02-26 08:31 UTC, Lorenz25
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lorenz25 2016-02-20 11:24:48 UTC
Created attachment 122816 [details]
Bug-NumberFormatChanges

I have this formula:
=IF(EXACT($B2,F$1), STYLE("Match"), STYLE("Default"))+5
Shows 5 as number format General. But when I copy/past it or replace the 5 with a 0 the number format gets changed to Boolean.
Comment 1 Lorenz25 2016-02-20 11:35:08 UTC
Tested further. This only happens with the custom "Match" style.
Comment 2 m_a_riosv 2016-02-21 01:04:41 UTC
Hi @Lorenz25, thanks for reporting.

'Match' style has the boolean format for numbers, so it's what you can expect.

I don't how C2 show '5' but after a hard recalc it shows as boolean.
Comment 3 Lorenz25 2016-02-21 07:14:00 UTC
No, that is not correct. I never set the number format to Boolean. And as you can read in the comment of F2 I can set it back to General, but then it goes back to Boolean after a recalc.
Comment 4 m_a_riosv 2016-02-21 18:19:39 UTC
Maybe you don't set but 'Match' style has the boolean format for numbers.
Comment 5 Lorenz25 2016-02-21 19:07:39 UTC
But I if I don't set it and it changes by itself, this is a bug. I want it to be General and it won't work.
Comment 6 m_a_riosv 2016-02-24 23:52:36 UTC
What if you modifies the 'Match' style to General?
Comment 7 Lorenz25 2016-02-25 09:04:40 UTC
Sorry, but I already told you, that it changes back to Boolean from General. And even if we assume, that it's the purpose of General to change to a fitting format, like if you enter a date and it becomes Date: I can set the format explicitly to Number and even then it changes to Boolean; which is not helpful. Anyway, thanks for looking into it, BTW.
Comment 8 m_a_riosv 2016-02-25 10:57:12 UTC
Created attachment 122984 [details]
Sample file modifying 'Match' style

Please could you est.
Comment 9 Lorenz25 2016-02-26 08:17:59 UTC
Great, now it changes from every other format to General. Tested it also with background color; changes back to blue. So, can I assume that I have to define the style somewhere else than in the Properties dialog of the cell?
Comment 10 Lorenz25 2016-02-26 08:31:04 UTC
Created attachment 123000 [details]
Two different formats in one style

I still don't get it. Without a formula I can modify the style locally. But is the usage of a style not, to define a format globally?
Comment 11 m_a_riosv 2016-02-26 10:06:28 UTC
You can find the documentation:

https://wiki.documentfoundation.org/Documentation/Publications#LibreOffice_Calc_Guide

Chapter 4 is about 'Using Styles and Templates.'
Comment 12 Lorenz25 2016-02-26 14:06:05 UTC
Got it! Thanks for the effort. But how it changed to Boolean in the first place, I still don't know.
Comment 13 m_a_riosv 2016-02-26 19:27:09 UTC
if you're the one who made the spreadsheet, and no one else touched it, ... :)

Really styles are very useful, something very interesting is the inheritance among styles, so that by changing any property of a style affects all who depend on it.
Comment 14 Lorenz25 2016-02-27 08:29:24 UTC
Yeah, but I must have accidentally changed the number format AND hit the update button, which I didn't know anything about. Strange...