# Meter library m.updateMeter() only int type

**URL:** <https://discourse.processing.org/t/meter-library-m-updatemeter-only-int-type/32070>\
**Category:** Libraries\
**Created:** [September 3, 2021, 9:42am UTC](https://discourse.processing.org/t/meter-library-m-updatemeter-only-int-type/32070 "2021-09-03T09:42:25Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![processing\_user](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@processing\_user](https://discourse.processing.org/u/processing_user)\
**Post date:** [September 3, 2021, 9:42am UTC](https://discourse.processing.org/t/meter-library-m-updatemeter-only-int-type/32070/1 "2021-09-03T09:42:25Z")

</div>

hi,  
I wanted to use the meter library but seems like the meter m.updateMeter() can only work with integer int type but I have float value and needed to display float values. How can I make it work?

thank you

---

<div class="post-metadata">

**Author:** ![micuat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micuat/32/19407_2.png) [@micuat](https://discourse.processing.org/u/micuat)\
**Post date:** [September 5, 2021, 5:36pm UTC](https://discourse.processing.org/t/meter-library-m-updatemeter-only-int-type/32070/2 "2021-09-05T17:36:54Z")

</div>

it would be so much helpful if you can post a code as a reference (for example, the code that works with integers, and you can point to the sections that you want to change to float)

---

<div class="post-metadata">

**Author:** ![processing\_user](https://avatars.discourse-cdn.com/v4/letter/p/7c8e57/32.png) [@processing\_user](https://discourse.processing.org/u/processing_user)\
**Post date:** [September 5, 2021, 9:03pm UTC](https://discourse.processing.org/t/meter-library-m-updatemeter-only-int-type/32070/3 "2021-09-05T21:03:31Z")

</div>

hi,  
i forgot to tell that the solution was to adjust the range of the slider to match the float value. so i got this one. but thanks next time i will post the code.

---

<div class="post-metadata">

**Author:** ![micuat](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/micuat/32/19407_2.png) [@micuat](https://discourse.processing.org/u/micuat)\
**Post date:** [September 5, 2021, 9:29pm UTC](https://discourse.processing.org/t/meter-library-m-updatemeter-only-int-type/32070/4 "2021-09-05T21:29:23Z")

</div>

Sure. Note that the forum is not only a place for you to get answers but also for other users to find information, so if you find solutions it would be helpful if you can follow up 🙂

---

<div class="post-metadata">

**Author:** ![IT1980](https://avatars.discourse-cdn.com/v4/letter/i/5e9695/32.png) [@IT1980](https://discourse.processing.org/u/IT1980)\
**Post date:** [June 6, 2022, 12:31pm UTC](https://discourse.processing.org/t/meter-library-m-updatemeter-only-int-type/32070/5 "2022-06-06T12:31:29Z")

</div>

Brand new to Processing here: I’m running into the same issue with m.updateMeter only accepting int, but not sure what the “slider” reference above refers to? In my case, I have a valid temp and humidity with 2 decimal places and just want the meter to display the full data:

if (port.available() \> 0) {  
String val = port.readString();  
list = split(val, ‘,’);  
float temp = float(list[0]);  
float hum = float(list[1]);

```
println("Temperature: " + temp + " F " + "Humidity: " + hum + " %");
m.updateMeter(int(temp));
m2.updateMeter(int(hum));

```

Maybe by design the library can only handle integers? In which case the OP’s question must be different.

Thanks for any ideas.

---

<div class="post-metadata">

**Author:** ![IT1980](https://avatars.discourse-cdn.com/v4/letter/i/5e9695/32.png) [@IT1980](https://discourse.processing.org/u/IT1980)\
**Post date:** [June 6, 2022, 5:07pm UTC](https://discourse.processing.org/t/meter-library-m-updatemeter-only-int-type/32070/6 "2022-06-06T17:07:35Z")

</div>

For my question, the answer was apparent after I figured out how to read the library reference:

```
m.setInformationAreaText(str(temp));
```
