# How to format float value send to screenLine1

**URL:** <https://forum.critterandguitari.com/t/how-to-format-float-value-send-to-screenline1/9519>\
**Category:** Patching\
**Created:** [May 28, 2023, 4:29am UTC](https://forum.critterandguitari.com/t/how-to-format-float-value-send-to-screenline1/9519 "2023-05-28T04:29:41Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![k3y8O4rd3r](https://avatars.discourse-cdn.com/v4/letter/k/54ee81/32.png) [@k3y8O4rd3r](https://forum.critterandguitari.com/u/k3y8O4rd3r)\
**Post date:** [May 28, 2023, 4:29am UTC](https://forum.critterandguitari.com/t/how-to-format-float-value-send-to-screenline1/9519/1 "2023-05-28T04:29:41Z")

</div>

Hello, I want to show values on the screen and I use the pure-data-message.  
“screenLine1 1: GrainLength $1ms”…

On the screen I get:

1. GrainLength 129.93847ms

Sometime I have so many digits, that the physical unit „ms“ is not anymore displayed, because the value is too long.

How can I format the value, to have only one digit after the separator.

---

<div class="post-metadata">

**Author:** ![Donnerbono](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/donnerbono/32/111_2.png) [@Donnerbono](https://forum.critterandguitari.com/u/Donnerbono)\
**Post date:** [May 28, 2023, 8:13am UTC](https://forum.critterandguitari.com/t/how-to-format-float-value-send-to-screenline1/9519/2 "2023-05-28T08:13:41Z")

</div>

Here’s a useful list of stuff [List of objects | Pure Data](https://pd.iem.sh/objects/)

int turns values into integer. So multiply value by 10, int object, divide by 10 will get you one decimal place (or something like that). Then send to screen.

---

<div class="post-metadata">

**Author:** ![chrka](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/chrka/32/5286_2.png) [@chrka](https://forum.critterandguitari.com/u/chrka)\
**Post date:** [May 28, 2023, 8:23am UTC](https://forum.critterandguitari.com/t/how-to-format-float-value-send-to-screenline1/9519/3 "2023-05-28T08:23:53Z")

</div>

You can also check the `[makefilename]` object which is useful for formatting things other than filenames. (To get only one digit after the decimal point you can use a format string such as `%.1f`)

---

<div class="post-metadata">

**Author:** ![Servandob](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.critterandguitari.com/servandob/32/5328_2.png) [@Servandob](https://forum.critterandguitari.com/u/Servandob)\
**Post date:** [May 29, 2023, 9:28am UTC](https://forum.critterandguitari.com/t/how-to-format-float-value-send-to-screenline1/9519/4 "2023-05-29T09:28:39Z")

</div>

use [int] , that will remove decimals.

---

<div class="post-metadata">

**Author:** ![k3y8O4rd3r](https://avatars.discourse-cdn.com/v4/letter/k/54ee81/32.png) [@k3y8O4rd3r](https://forum.critterandguitari.com/u/k3y8O4rd3r)\
**Post date:** [May 29, 2023, 10:08am UTC](https://forum.critterandguitari.com/t/how-to-format-float-value-send-to-screenline1/9519/5 "2023-05-29T10:08:07Z")

</div>

Thank you, this is very useful. The functions name is a little misleading, but it works.

---

<div class="post-metadata">

**Author:** ![k3y8O4rd3r](https://avatars.discourse-cdn.com/v4/letter/k/54ee81/32.png) [@k3y8O4rd3r](https://forum.critterandguitari.com/u/k3y8O4rd3r)\
**Post date:** [May 29, 2023, 10:08am UTC](https://forum.critterandguitari.com/t/how-to-format-float-value-send-to-screenline1/9519/6 "2023-05-29T10:08:24Z")

</div>

Thank you very much.

---

<div class="post-metadata">

**Author:** ![k3y8O4rd3r](https://avatars.discourse-cdn.com/v4/letter/k/54ee81/32.png) [@k3y8O4rd3r](https://forum.critterandguitari.com/u/k3y8O4rd3r)\
**Post date:** [May 29, 2023, 10:08am UTC](https://forum.critterandguitari.com/t/how-to-format-float-value-send-to-screenline1/9519/7 "2023-05-29T10:08:39Z")

</div>

Very good.
