# Rounded display

**URL:** <https://community.homey.app/t/rounded-display/86302>\
**Category:** Questions & Help\
**Created:** [August 6, 2023, 10:53am UTC](https://community.homey.app/t/rounded-display/86302 "2023-08-06T10:53:01Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matthieu\_Moreau](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matthieu_moreau/32/57526_2.png) [@Matthieu\_Moreau](https://community.homey.app/u/Matthieu_Moreau)\
**Post date:** [August 6, 2023, 10:53am UTC](https://community.homey.app/t/rounded-display/86302/1 "2023-08-06T10:53:01Z")

</div>

Good morning

this function works perfectly but the return format does not suit me.

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/d/b/dbccde90a0f46da9d653b370cf8d0308306b0735.png)

If the temperature is in decimal then it displays the decimal, example: Temp = 23.5° → 23.5°

If the temperature is an integer it displays the integer, ex: 23° → 23°

I would like it to always display in decimal: 23° → 23.0°

I tried with the ROUND function but it doesn’t work.

If someone has an idea…

---

<div class="post-metadata">

**Author:** ![MariusGundersen](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/mariusgundersen/32/74167_2.png) [@MariusGundersen](https://community.homey.app/u/MariusGundersen)\
**Post date:** [August 6, 2023, 4:33pm UTC](https://community.homey.app/t/rounded-display/86302/2 "2023-08-06T16:33:35Z")

</div>

I’m guessing it’s a string, since it contains °, and you can’t call round on string. If you can create a homeyScript then what you need to do is parseFloat and then call ToFixed(1) on the result

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [August 6, 2023, 5:44pm UTC](https://community.homey.app/t/rounded-display/86302/3 "2023-08-06T17:44:25Z")

</div>

It depens on the LocalAPI app I think. You insert a nuneric token and the app returns a JSON.  
How is the JSON built? With numeric value or string value?  
If the JSON contains a string element, then it’s converted from number ti string inside LocalAPI app.  
I suggest to ask the app developer 😉

---

<div class="post-metadata">

**Author:** ![Matthieu\_Moreau](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matthieu_moreau/32/57526_2.png) [@Matthieu\_Moreau](https://community.homey.app/u/Matthieu_Moreau)\
**Post date:** [August 7, 2023, 10:21am UTC](https://community.homey.app/t/rounded-display/86302/4 "2023-08-07T10:21:15Z")

</div>

It is a numeric value

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/d/0d4d27ce027540fa437cb2713d5bb16bc2942b51.png)

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [August 7, 2023, 4:54pm UTC](https://community.homey.app/t/rounded-display/86302/5 "2023-08-07T16:54:33Z")

</div>

Have you already checked the data source, means the device capability at [Homey Developer Tools](https://tools.developer.homey.app/tools/devices) ?

---

<div class="post-metadata">

**Author:** ![Matthieu\_Moreau](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/matthieu_moreau/32/57526_2.png) [@Matthieu\_Moreau](https://community.homey.app/u/Matthieu_Moreau)\
**Post date:** [August 7, 2023, 5:53pm UTC](https://community.homey.app/t/rounded-display/86302/6 "2023-08-07T17:53:55Z")

</div>

that’s to say ?

![image](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/a/b/abd0eb5b442fd5b588abda09521d0f98bc558aea.png)

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [August 7, 2023, 7:30pm UTC](https://community.homey.app/t/rounded-display/86302/7 "2023-08-07T19:30:43Z")

</div>

You can use the Better Logic Library app for this.

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [August 7, 2023, 8:22pm UTC](https://community.homey.app/t/rounded-display/86302/8 "2023-08-07T20:22:35Z")

</div>

I meant the capability like…

 ![Screenshot_20230807_215434_Firefox](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/a/8a5d4733a32d834e27bcfd66ce7c625a76a9ebd6.jpeg)

I also tried to use the logic card to round a value.  
Round a value like 1.23 gives 1 as result. So you can round like round(1.23×10)/10 to get 1.2  
Problem: round(1x10)/10 gives 1 as result, not 1.0  
I would say that’s why you get no zeros as decimal.

---

<div class="post-metadata">

**Author:** ![Arie\_J\_Godschalk](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/arie_j_godschalk/32/63027_2.png) [@Arie\_J\_Godschalk](https://community.homey.app/u/Arie_J_Godschalk)\
**Post date:** [August 13, 2023, 2:35pm UTC](https://community.homey.app/t/rounded-display/86302/9 "2023-08-13T14:35:59Z")

</div>

Where do you want to see the rounded value?
