# Not able to convert float to integer using convert processor

**URL:** <https://discuss.elastic.co/t/not-able-to-convert-float-to-integer-using-convert-processor/139269>\
**Category:** Elasticsearch\
**Created:** [July 10, 2018, 5:32am UTC](https://discuss.elastic.co/t/not-able-to-convert-float-to-integer-using-convert-processor/139269 "2018-07-10T05:32:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![roshni](https://avatars.discourse-cdn.com/v4/letter/r/ce7236/32.png) [@roshni](https://discuss.elastic.co/u/roshni)\
**Post date:** [July 10, 2018, 5:32am UTC](https://discuss.elastic.co/t/not-able-to-convert-float-to-integer-using-convert-processor/139269/1 "2018-07-10T05:32:37Z")

</div>

Hi ,

I first defined a pipeline as follows -  
`curl -X PUT "node1:9200/_ingest/pipeline/convertpipeline" -H 'Content-Type: application/json' -d' { "description": "convert type pipeline", "processors" : [{ "convert": { "field" : "number", "type": "integer" } }] } '`

Then i tested using the following -

```
curl -X PUT "node1:9200/myindex/doc/1?pipeline=convertpipeline" -H 'Content-Type: application/json' -d'
{
  "number" : "15.88"
}
'

```

and

```
` curl -X PUT "node1:9200/myindex/doc/1?pipeline=convertpipeline" -H 'Content-Type: application/json' -d'
{
  "number" : 15.88
}
'`

```

It failed to covert float to integer .. ?? Any help on how and why ??

Thanks

---

<div class="post-metadata">

**Author:** ![james5](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/james5/32/33181_2.png) [@james5](https://discuss.elastic.co/u/james5)\
**Post date:** [July 10, 2018, 5:41am UTC](https://discuss.elastic.co/t/not-able-to-convert-float-to-integer-using-convert-processor/139269/2 "2018-07-10T05:41:45Z")

</div>

Because the template still has it as keyword/string on the index?  
(i've never used convertpipeline).  
I ususally do this by changing the template, then reindex the index.

---

<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 7, 2018, 5:41am UTC](https://discuss.elastic.co/t/not-able-to-convert-float-to-integer-using-convert-processor/139269/3 "2018-08-07T05:41:52Z")

</div>

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