Bug 156859 - Wrong fractional value
Summary: Wrong fractional value
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.6.0.3 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-08-22 13:50 UTC by Massimo
Modified: 2023-08-22 14:02 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
A Calc file with the steps I have described in the bug report (10.47 KB, application/vnd.oasis.opendocument.spreadsheet)
2023-08-22 13:52 UTC, Massimo
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Massimo 2023-08-22 13:50:43 UTC
Description:
Number from fraction and fraction from number do not show the same result

Steps to Reproduce:
In LO 7.6, module Calc, do the following

In a cell, e.g. A1, type "=11/12". You get 0.91666666....7
In the next cell (ex. B1) type "=A1"
Right-click that cell, choose "Format cell" and then "Fraction". 
You get 8/9 instead of 11/12

Actual Results:
8/9

Expected Results:
11/12


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 7.6.0.3 (X86_64) / LibreOffice Community
Build ID: 69edd8b8ebc41d00b4de3915dc82f8f0fc3b6265
CPU threads: 6; OS: Windows 10.0 Build 22621; UI render: Skia/Raster; VCL: win
Locale: ja-JP (ja_JP); UI: en-GB
Calc: CL threaded
Comment 1 Massimo 2023-08-22 13:52:08 UTC
Created attachment 189095 [details]
A Calc file with the steps I have described in the bug report

A Calc file with the steps I have described in the bug report
Comment 2 Mike Kaganski 2023-08-22 14:02:43 UTC
The default fractional format (used in your sample file) is

  #" "?/?

which uses a single '?' for numerator, and a single '?' for denominator. This way, it uses single-digit fraction.

Use two '?'s (in denominator - that's where it's important; in numerator, it will use as many digits as needed), that's how you control the precision of your fraction. This also happens when you use the number format dialog's Denominator places.

Closing NOTABUG.