# Canvas - Get element to understand 1.234 is a number

**URL:** <https://discuss.elastic.co/t/canvas-get-element-to-understand-1-234-is-a-number/191383>\
**Category:** Kibana\
**Created:** [July 19, 2019, 11:32am UTC](https://discuss.elastic.co/t/canvas-get-element-to-understand-1-234-is-a-number/191383 "2019-07-19T11:32:37Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![u3432](https://avatars.discourse-cdn.com/v4/letter/u/cab0a1/32.png) [@u3432](https://discuss.elastic.co/u/u3432)\
**Post date:** [July 19, 2019, 11:32am UTC](https://discuss.elastic.co/t/canvas-get-element-to-understand-1-234-is-a-number/191383/1 "2019-07-19T11:32:37Z")

</div>

Hi all, I am trying to use a progress bar to show response time. The time shows as 1.234 how can I get the bar to work will this data? Also in Logstash the grok for the data is set to number.

Thank You.

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [July 19, 2019, 8:25pm UTC](https://discuss.elastic.co/t/canvas-get-element-to-understand-1-234-is-a-number/191383/2 "2019-07-19T20:25:19Z")

</div>

The progress bar shows a percentage of a whole, so it expects the value to be between 0 and 1. You could do some math on the value, but would would "100%" be for your response time field? Just based on the field name, it doesn't sound to me like the progress bar would be the most appropriate visualization for it.

---

<div class="post-metadata">

**Author:** ![u3432](https://avatars.discourse-cdn.com/v4/letter/u/cab0a1/32.png) [@u3432](https://discuss.elastic.co/u/u3432)\
**Post date:** [July 22, 2019, 9:17am UTC](https://discuss.elastic.co/t/canvas-get-element-to-understand-1-234-is-a-number/191383/3 "2019-07-22T09:17:31Z")

</div>

It seems to work fine using a cast. I have set the max to 5 because nothing should be over 5 seconds. Is it possible to limit the values using average to something like 0.219? Im getting something like 0.2191259999999999993256 and want to cut that down as possible.

---

<div class="post-metadata">

**Author:** ![wadhah](https://avatars.discourse-cdn.com/v4/letter/w/bc8723/32.png) [@wadhah](https://discuss.elastic.co/u/wadhah)\
**Post date:** [July 22, 2019, 12:21pm UTC](https://discuss.elastic.co/t/canvas-get-element-to-understand-1-234-is-a-number/191383/4 "2019-07-22T12:21:57Z")

</div>

you can use round lie for example let's say x= 0.2191259999999999993256 and you want to display 0.219, you can do round(x,3)

---

<div class="post-metadata">

**Author:** ![u3432](https://avatars.discourse-cdn.com/v4/letter/u/cab0a1/32.png) [@u3432](https://discuss.elastic.co/u/u3432)\
**Post date:** [July 24, 2019, 2:28pm UTC](https://discuss.elastic.co/t/canvas-get-element-to-understand-1-234-is-a-number/191383/5 "2019-07-24T14:28:57Z")

</div>

Great thank you very much.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [August 21, 2019, 2:29pm UTC](https://discuss.elastic.co/t/canvas-get-element-to-understand-1-234-is-a-number/191383/6 "2019-08-21T14:29:06Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
