# How to Modify Decimal Precision and Labels in Slicer Markups

**URL:** <https://discourse.slicer.org/t/how-to-modify-decimal-precision-and-labels-in-slicer-markups/39565>\
**Category:** Support\
**Created:** [October 7, 2024, 12:58pm UTC](https://discourse.slicer.org/t/how-to-modify-decimal-precision-and-labels-in-slicer-markups/39565 "2024-10-07T12:58:54Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Deep\_Learning](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deep_learning/32/15345_2.png) [@Deep\_Learning](https://discourse.slicer.org/u/Deep_Learning)\
**Post date:** [October 7, 2024, 12:58pm UTC](https://discourse.slicer.org/t/how-to-modify-decimal-precision-and-labels-in-slicer-markups/39565/1 "2024-10-07T12:58:54Z")

</div>

I’m wondering how to change the number of decimal points displayed in markup text—for example, adjusting the length of a line markup from two decimal points to one.

Additionally, is it possible to remove the markup name in the 3D view and only display the length?

Thanks for your help!

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [October 7, 2024, 2:11pm UTC](https://discourse.slicer.org/t/how-to-modify-decimal-precision-and-labels-in-slicer-markups/39565/2 "2024-10-07T14:11:49Z")

</div>

Good question - I don’t see that this is exposed in the GUI.

Also I would have thought that something like this would work, but it seems the PrintFormat doesn’t change. Perhaps someone with more knowledge about how the Markups are implemented can comment.

```auto
l = getNode("L")
ll = l.GetMeasurement("length")
ll.SetPrintFormat("%g")

```

---

<div class="post-metadata">

**Author:** ![Deep\_Learning](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deep_learning/32/15345_2.png) [@Deep\_Learning](https://discourse.slicer.org/u/Deep_Learning)\
**Post date:** [October 8, 2024, 9:53am UTC](https://discourse.slicer.org/t/how-to-modify-decimal-precision-and-labels-in-slicer-markups/39565/3 "2024-10-08T09:53:42Z")

</div>

I would be happy to script it… I found something called precision, but I do not think that it is related to the display. I always get 2 decimal points displayed in the 3D View.

> [@How to change the default precision of fiducials?](https://discourse.slicer.org/t/how-to-change-the-default-precision-of-fiducials/6157):
>
> Hello, I’d like to add more significant digits to fiducial points when saving to a FCSV file. I can set the values I want using Python, but the Markups table and the output FCSV file show the default precision. I have tried changing the precision under Application Settings-\> Units but this doesn’t impact the fiducial points. Is there a way to do this? Thank you for your help. Sara

---

<div class="post-metadata">

**Author:** ![pieper](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/pieper/32/8_2.png) [@pieper](https://discourse.slicer.org/u/pieper)\
**Post date:** [October 8, 2024, 2:37pm UTC](https://discourse.slicer.org/t/how-to-modify-decimal-precision-and-labels-in-slicer-markups/39565/4 "2024-10-08T14:37:19Z")

</div>

In the Application Settings → Units you can set the precision.

Right now the inclusion of the node name and colon character are hard coded, so some C++ code would be need (or a workaround with and extra markup point with custom label or something).

---

<div class="post-metadata">

**Author:** ![Deep\_Learning](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.slicer.org/deep_learning/32/15345_2.png) [@Deep\_Learning](https://discourse.slicer.org/u/Deep_Learning)\
**Post date:** [October 19, 2024, 11:35am UTC](https://discourse.slicer.org/t/how-to-modify-decimal-precision-and-labels-in-slicer-markups/39565/5 "2024-10-19T11:35:09Z")

</div>

Thanks for your reply… very helpful.  
A few notes for others. Precision seems to be the number of total digits. This worked for me, but if set to 2, one would get 1.2mm, 9.9mm and 24mm. (no decimal on the \>=10).  
I can get rid of the Markupnode labels, by changing the name. Changing to “” (empty string) works, but on saving/loading the mrb, A generic name is given to the missing names. changing the names to " " (space) gives some persistence.
