# Percentage Formatting

**URL:** https://discuss.elastic.co/t/percentage-formatting/124417
**Category:** Logstash
**Created:** [March 17, 2018, 7:40pm UTC](https://discuss.elastic.co/t/percentage-formatting/124417 "2018-03-17T19:40:37Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![wwalker](https://avatars.discourse-cdn.com/v4/letter/w/43a26b/32.png) [@wwalker](https://discuss.elastic.co/u/wwalker)
#### Post date: [March 17, 2018, 7:40pm UTC](https://discuss.elastic.co/t/percentage-formatting/124417/1 "2018-03-17T19:40:37Z")

</div>

Not really sure where this belongs to be honest. I am ingesting a field that has a numeric value that represents a percentage. So 5 is 5%, 50 is 50%, 100 is 100%. Unfortunately, I can't figure out the Kibana formatting to not add additional zeros onto the existing value (currently, it sees 100 as 10,000%) and I can't find an elasticsearch data type to identify it as a percentage. Is there a way in Logstash I can run math on the number to convert it to a decimal expression?

---

<div class="post-metadata">

### Author: ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)
#### Post date: [March 17, 2018, 8:04pm UTC](https://discuss.elastic.co/t/percentage-formatting/124417/2 "2018-03-17T20:04:51Z")

</div>

Use a ruby filter with the following code:

```
event.set('fieldname', event.get('fieldname') / 100)

```

But I'd be surprised if Kibana's field formatter wasn't capable of formatting this properly.

---

<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: [April 14, 2018, 8:05pm UTC](https://discuss.elastic.co/t/percentage-formatting/124417/3 "2018-04-14T20:05:05Z")

</div>

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