Bug 138414 - In Draw, number of decimal points in dimension lines is not applied
Summary: In Draw, number of decimal points in dimension lines is not applied
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
7.0.3.1 release
Hardware: All All
: medium normal
Assignee: Andreas Heinisch
URL:
Whiteboard: target:26.8.0
Keywords: difficultyMedium, easyHack, skillCpp
Depends on:
Blocks: Shapes-Line
  Show dependency treegraph
 
Reported: 2020-11-22 17:37 UTC by Petr Tichý
Modified: 2026-04-29 20:00 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Picture with different approaches of decimal points. (12.19 KB, image/png)
2020-11-22 17:44 UTC, Petr Tichý
Details
3 steps for the bug (39.90 KB, image/png)
2023-02-21 20:50 UTC, Stéphane Champeau
Details
Overflow error in dimension dialog (30.63 KB, image/png)
2026-03-26 15:30 UTC, Andreas Heinisch
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Petr Tichý 2020-11-22 17:37:08 UTC
Description:
Hi dear support.
When I create a dimension line, for example 21cm on page format A2, then the number of decimal point is not applied. In case number of decimal point is 1, then the dimension shall be depicted as "21.0 cm". But there is "21 cm".
Thank you for your time and bug fix.

Steps to Reproduce:
1. Create dimension line with length for example exactly 5 cm.
2. Check number of decimal points is at least 1.
3. Dimension is still depicted as "5 cm", not "5.0 cm".

Actual Results:
5 cm

Expected Results:
5.0 cm


Reproducible: Always


User Profile Reset: Yes


OpenGL enabled: Yes

Additional Info:
Version: 7.0.3.1 (x64)
Build ID: d7547858d014d4cf69878db179d326fc3483e082
CPU threads: 8; OS: Windows 10.0 Build 19042; UI render: Skia/Raster; VCL: win
Locale: cs-CZ (cs_CZ); UI: cs-CZ
Calc: CL
Comment 1 Petr Tichý 2020-11-22 17:44:16 UTC
Created attachment 167479 [details]
Picture with different approaches of decimal points.

Picture depicts how the number of decimal points is applied according to real dimension.
Comment 2 raal 2020-11-27 13:58:40 UTC
Need to be confirmed independently,setting back to Unconfirmed.
Does it worked before?
Comment 3 Petr Tichý 2020-11-30 09:18:28 UTC
I have never used it before.
Comment 4 pavlog 2020-12-13 21:49:04 UTC
Thanks for reporting, I can confirm it in

Version: 7.2.0.0.alpha0+ (x64)
Build ID: ecb916667b633f8647790e040226b093760e6cfe
CPU threads: 4; OS: Windows 10.0 Build 18363; UI render: Skia/Vulkan; VCL: win
Locale: en-US (en_US); UI: en-US
Calc: CL
Comment 5 QA Administrators 2022-12-14 03:20:57 UTC Comment hidden (obsolete)
Comment 6 Stéphane Champeau 2023-02-21 20:43:33 UTC
Confirmed on : 
Version: 7.5.0.3 (X86_64) / LibreOffice Community
Build ID: c21113d003cd3efa8c53188764377a8272d9d6de
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: fr-FR (fr_FR); UI: fr-FR
Calc: CL threaded

Image 'bug libre offfice draw dimensions line 7.5.0.png"
1) Dimension line of 195cm display in cm with 2 decimal (should display 195.00 cm)   
2) Change display unit to "meter" with 2 decimal
3) BUG => should diplay 1.95 m
Comment 7 Stéphane Champeau 2023-02-21 20:50:52 UTC
Created attachment 185514 [details]
3 steps for the bug
Comment 8 Petr Tichý 2023-02-26 00:16:06 UTC
The bug is still present in version 7.5.0.3 (X86_64) / LibreOffice Community.
Setting of decimal point is not respected.
Comment 9 QA Administrators 2025-05-05 03:10:16 UTC Comment hidden (obsolete)
Comment 10 Andreas Heinisch 2026-03-26 15:30:19 UTC
Created attachment 206416 [details]
Overflow error in dimension dialog

Should we add a checkbox to indicate whether zeros should be stripped? Lets ask the design team.
Comment 11 Andreas Heinisch 2026-03-26 16:47:15 UTC
Code pointer: SdrMeasureObj::TakeRepresentation
Comment 12 Heiko Tietze 2026-04-09 08:59:36 UTC
No need for input from UX. 

The bug should be fixed (an upper limit for the decimal points of 4 sounds sufficient) and the decimal places respected.

This feature needs a checkbox "[x] Automatic" to keep the current behavior (lines at precise values keep 5cm and minor deviations like 4.95cm are shown as best as possible).

The dialog's preview uses black to draw lines. This needs to be changed into WindowTextColor to work on dark themes.
Comment 13 Commit Notification 2026-04-29 15:53:57 UTC
Andreas Heinisch committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/90890974c2e843e615a95286e29c3114342f2b28

tdf#138414 - Respect decimal precision for dimension lines

It will be available in 26.8.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.
Comment 14 Andreas Heinisch 2026-04-29 16:16:13 UTC
After resolving this issue, the rounding problems in the dialog became more noticeable. I will file a separate bug report to address them.