inserting fractions in the calc cell [closed]
in the calc cells if I enter 9/100 it shows 8/89. Any one please tell how to fix this problem.
Thanks a lot for your help.
First time here? Check out the FAQ!
in the calc cells if I enter 9/100 it shows 8/89. Any one please tell how to fix this problem.
Thanks a lot for your help.
Go to the "Format Cells" as shown by Alex Kemp. Then select Fractions on left side. You will see in the middle column 2 predefined formats: # ?/? and # ??/??. select the second one ( where it says now General you will see it) and modify it to # ??/???.
Then you get your right display.
ADDON: My solution is only good for the actual session. LO does not save the fraction anywhere, so it gets lost after saving and reopening. Although it saves other user-defined formats (had some phone number saved in the test file and there were still ok). I might have to write a bugreport.
2.ADDON: There is already a bug#88657 filed beginning of 2015. One workaround found and confirmed by me is to use
"# ???/???" as format. This works to and is saved.
Hi GA316
The normal reason for wrong display of numbers containing a slash ('/') as reported in ask.libo is that the default for Calc for the questioner is to format as a date. The reason in your case is a variant upon that, and for me has revealed a truly abominable piece of coding...
With Calc, each cell is rather like a human being:- there is the body & there are the clothes (display). Sometimes one matches the other, and sometimes not. Also, small boys have a habit of hiding things in their pockets (preciousss).
With the cursor within the cell containing '9/100', try the following:
- (
menu
):Format
→Clear Direct Formatting
(Ctrl+M
)
(from now on you will see the default format)- (
menu
):Format
→Cells
(Ctrl+1
)
(what is the value inFormat code
?)
(mine wasNumber
→General
, and the display showed for me as "9/100")
That previous result was because Calc silently inserted a hidden ' (U+0027) APOSTROPHE within the cell before the 9/100; the APOSTROPHE could be seen in the input line of the Formula Bar only after changing the format to Fraction; it was always hidden within the cell, and otherwise hidden within the Formula Bar; I removed the APOSTROPHE and tried again (lo-5.0.0.5 Debian 6.0)
(changing format toFraction
→"# ??/??"
then showed your result of 8/89 - hooray!)- Modify
Format code
to"# ??/???"
(display now returns to 9/100) (thanks horst)
If this helps then please tick the answer (✔)
...and/or show you like it with an uptick (∧)
Additionally to answer by @horst:
You can also choose an Fractionsformatcode like # ??/100
to fix the denominator for some Reasons
(Edited) You ( @GA316 ) had formatted the respective cell(s) using a format code like "# ?/??" or "# ?/#?" for fractions up to 2 digits for the denominator. 8/99 is the best approximation for 9/100 available if the denominator is limited to 2 digits.
Generally you shouldn't expect reliable results displayed using 'Fraction' format. The arithmetic is always 'Double'. Applying an algorithm of continued fractions afterwards is kind of a hoax. If you need exact fractional arithmetic you have to use mathematics software. (Maxima is free now.)
The fact that the number format 'Fraction' set for a cell also causes the "recognition" of "9/100" as not text can be seen as an inconsistency. This behaviour may get in conflict with a 'date acceptance pattern'. Presently it will even override it. Did anyone at anytime specify the bahaviour of such toys?
(Editing again:)
@horst may have a look into the attached example. I did, however, not yet demonstrate similar effects with non-fractional formats. (No examples stored formerly) ask59529FractionTests.ods
Asked: 2015-10-15 19:52:43 +0100
Seen: 1,144 times
Last updated: Oct 17 '15
How do I export a chart in an image format from LibreOffice Calc? [closed]
Are there plans for a "papercut" project for libreoffice [closed]
Is it normal for Calc goal seek to take very long? [closed]
Please refine "Search" in Calc - implement functions in Gnumeric [closed]
LibreOffice Calc will not link to external data via internet [closed]
Is there a LibreOffice .odt, .ods viewer for Android? [closed]
Why is Calc so much slower at opening/saving files than MS-Office? (win7 x64) [closed]
What is your locale, what your UI language, what your OS, what you OS language/locale, what your LibO version? Even knowing all that I might not have help for you. Without this information it's hopless. My LibO doesn't behave that way. Down with silly "recognition!