Why calc fraction returns wrong answer.

When I put .75 in a1 and put =a1 in a2 and format a2 as fraction, I get the number 1 instead of 3/4. I tried all of the present formats(??/??) but none gives me 3/4. Tried this in excel and WPS office and it work correctly, but not in Libre Office Calc. Try it for yourself

Thanks:
Rich.

Here is a screenshot of calc.
Libre Office Calc fractions.png

Here is an image if screenshot above doesn’t work for you.

Other fractions work fine, just some fractions returns 1 in the cell. Can’t remember which ones malfunctions. I’ll try and find out for you and try to make a list. May take some time to do.

Here are fractions in 1/32 in increments. I have Libre Office Ver 5.4.4.2

Here if a file with the fraction format ??/?? I hope I did this up load correctly.
LO Fraction1.ods

Here is anoter attachment I’ll send you. I just formatted to fractions.
LO Fraction2.ods

Here are two more files to look at. one ODS the other XLSX

Decimal to Fraction.xlsx

Decimal to Fraction.ods

If the files I"m uploading to you do work on your Libre Office calc and don’t work on mine that probably means that there is something wrong with my installation. That"s why I sent you screenshots of the the files in question. Is that possible? Should I try and uninstall and reinstall Libre Office?
Thanks:
Rich

Here is Decimals to Fractions.ods.
Decimal to Fraction.ods

Hello @Richlib,

i could not reproduce this behaviour in my LibreOffice Calc version 5.4.2.2 Build ID: 1:5.4.2-0ubuntu0.17.10.

Cell A2 comes out correctly as 3/4, after i had set its Numberformat to “Fraction” with Format Code # ?/?.

Regards, lib

Version?
Did Calc accept your lazy “.75” as 0.75?
Exact format code strings tested?
For me fraction formats work fine for a long time now and also in V 6.0.0…

@Richlib: Please upload a document showing the issue for you. To do so edit your question and use the tool with the icon looking like a paperclip.

How do I edit this some more I want to add another png calc file to sow you. It wont let me edit.

Thats ok I was able to edit and add a png screenshot.

perhaps this behaviour is somehow related to the “/” character inside the Format Code string…

Please try in these cases the following Format Code string instead:

# ??\/??

( placing a “” in front of the “/” )

Sigh. Is that so difficult to upload a document as @Lupp asked, instead of the screenshots?

Is that impossible to mention program version? Unbelievable.

Don’t know what you mean Mike, please clarify. I’m not an expert here, just learning.:slight_smile:

The document is what you created once and are working in now and then.
To have another shift tomorrow with that document you will want to save it out of the RAM to a persistent
representation: the file that eventually resides on your HD or somewhere, and that will be reloaded if needed.
There are different “filters” applicable when saving and different “formats” of the files. Knowledge about this (on my behalf) may be relevant for finding advice. I need the spreadsheet file.

I uploaded 2 small files I was working on, is that what you mean? I saved both one in documents folder and the other on the desktop on my computer… They are temporary small files to experiment on. Thanks for the info. :slight_smile: My Libre Office Version 5.4.4.2 Build ID: 1:5.4.4~rc2-0ubuntu0.17.10.1~lo1

I opened both the files (.ods and .xlsx) and checked the fractions displayed in column E. They were correct in every case. (Meanwhile I completed the test with another version. 5.4.4 and 6.0.0 showed no differences.)
Which cell (name one or two) showed a wrong fraction (which one) for you?
Did you try the suggestion concerning your user profile?

Ok cells showing a 1 instead of 3/4 in decimals to fractions.ods B5, B10, B24, E2, E8, E16 and of course E32 is correct I’ll upload the file again.

Opened the second file. Cell A is formatted as Number, no specs for number of decimals. When I set that to 2 decimals, B1 displays 3/4. When I reduce it to 1 decimal, A1 displays 0.8 and B1 displays 4/5. Apparently Calc displays the number rounded to the selected number of decimals, and if nothing is entered there, it assumes 0 decimals and rounds to the nearest whole number…

Wow. Good catch. And I suppose, it is a bug. Formatting of original cell should not affect dependent cell formatting.

I tried that but still the same result. Maybe a newer version of Libre Office is needed for ubuntu Mate 17.10

The document is set to “Precision as shown”!
That’s a very dangerous option that should be abandoned, imo.
In addition: When I downloaded the “C:\fakepath\LO Fraction1.ods” attachment, the cell B1 had the absurd ‘Numbers’ format code #"/"##.

That number format can not work as intended. Calculating with precision as shown in the context of fractions was enhanced for version 6.0

Hello @Richlib,

Please try the following steps:

  1. select your cell B1;
  2. select the menu Format : Clear Direct Formatting;
  3. then set the correct Number Format again…

HTH, lib

This works. The cell is formatted to cell / format / numbers / general / 12/25.
It should be cell / format / numbers / fraction/ whatever.