Ask Your Question

inserting fractions in the calc cell [closed]

asked 2015-10-15 19:52:43 +0100

GA316 gravatar image

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.

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by Alex Kemp
close date 2020-08-26 20:33:37.599248


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!

Lupp gravatar imageLupp ( 2015-10-16 23:02:06 +0100 )edit

4 Answers

Sort by » oldest newest most voted

answered 2015-10-16 23:17:23 +0100

horst gravatar image

updated 2015-10-17 22:05:23 +0100

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.

edit flag offensive delete link more


Custom format codes not correctly saved / reloaded while first working as expected, are not restricted to 'Fraction' based formats.

If you decide to file a bug report: Would you mind to also post a link to it, here?

Lupp gravatar imageLupp ( 2015-10-17 17:23:22 +0100 )edit

answered 2015-10-16 18:33:45 +0100

Alex Kemp gravatar image

updated 2015-10-17 14:37:31 +0100

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...

Try to Remember:

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:

  1. (menu):FormatClear Direct Formatting (Ctrl+M)
    (from now on you will see the default format)
  2. (menu):FormatCells (Ctrl+1)
    (what is the value in Format code?)
    (mine was NumberGeneral, 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- Debian 6.0)

    (changing format to Fraction"# ??/??" then showed your result of 8/89 - hooray!)
    image description
  3. Modify Format code to "# ??/???"
    (display now returns to 9/100) (thanks horst)
    image description

If this helps then please tick the answer (✔)
...and/or show you like it with an uptick ()

edit flag offensive delete link more


@Alex Kemp: We talk about Numberformat-category: Fractions

karolus gravatar imagekarolus ( 2015-10-17 11:03:27 +0100 )edit

answered 2015-10-17 10:58:16 +0100

karolus gravatar image

Additionally to answer by @horst:

You can also choose an Fractionsformatcode like # ??/100 to fix the denominator for some Reasons

edit flag offensive delete link more

answered 2015-10-16 23:07:50 +0100

Lupp gravatar image

updated 2015-10-17 17:47:55 +0100

(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

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2015-10-15 19:52:43 +0100

Seen: 1,144 times

Last updated: Oct 17 '15