Number formatting supports fixed denominators and so-called improper fractions without splitting off the integer part. A respective format code is e.g. "?/8". If the formatting requires the roundig UP to an integer, the diplayed result is 0/0. Example: 1.995 formatted using the code ?/8 results in 0/0. The expected correct result would be 16/8. The error is bound to the AMOUNT of the input, and does not occur if the integer result to show is obtained by rounding DOWN. This seems to be a regression introduced with V 5.3. That version implemented a new algorithm for fractional formatting. That algorithm should, however, not be related to the reported bug. It only provides the raw result. If an integer part is split off or not should occur later. Cf tdf#99996 . Older versions don't show the bug. Support for fix demominators was introduced verty early in LibO, but was not heritage.
Confirmed with Version: 7.5.0.3 (X86_64) / LibreOffice Community Build ID: c21113d003cd3efa8c53188764377a8272d9d6de CPU threads: 8; OS: Linux 5.15; UI render: default; VCL: gtk3 Locale: fr-FR (fr_FR.UTF-8); UI: fr-FR Calc: threaded
Reproduce with free denominator as well 1. Enter value 1.95 2. Format as ?/? (no integer part) Actual result: 0/0 Expected result: 2/1 No problem if value is 2 or slightly above like 2.001. Bug occurs when value is below integer. No change if other digit codes (# or 0) are used to create fraction format.
I think the bug was introduced by https://cgit.freedesktop.org/libreoffice/core/commit/svl/source/numbers/zformat.cxx?id=5706b29974c1c3ab0ba5a23685accf2fbebc3e06 https://opengrok.libreoffice.org/xref/core/svl/source/numbers/zformat.cxx?r=2cb2e2b9#2891 nDiv should not be reset to 0, but to 1 or forced denominator unfortunately, all our unit tests round down the value, so this bug was not detected.
Laurent Balland committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/dc9b8c31aaf72812dc205f610638098898a4cde7 tdf#153887 Fraction number format: avoid 0/0 It will be available in 7.6.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Laurent Balland committed a patch related to this issue. It has been pushed to "libreoffice-7-5": https://git.libreoffice.org/core/commit/072f84001b2d28915085909a4d9a5a52bd7f6b61 tdf#153887 Fraction number format: avoid 0/0 It will be available in 7.5.3. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Laurent Balland committed a patch related to this issue. It has been pushed to "libreoffice-7-4": https://git.libreoffice.org/core/commit/40beefc591d8417f1291834fe66a348678241820 tdf#153887 Fraction number format: avoid 0/0 It will be available in 7.4.7. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.