# Kibana Scripted field : Not able to parse the String to Double/Int

**URL:** <https://discuss.elastic.co/t/kibana-scripted-field-not-able-to-parse-the-string-to-double-int/279590>\
**Category:** Elasticsearch\
**Tags:** painless\
**Created:** [July 26, 2021, 5:24am UTC](https://discuss.elastic.co/t/kibana-scripted-field-not-able-to-parse-the-string-to-double-int/279590 "2021-07-26T05:24:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rohit\_Dwivedi](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rohit_dwivedi/32/91845_2.png) [@Rohit\_Dwivedi](https://discuss.elastic.co/u/Rohit_Dwivedi)\
**Post date:** [July 26, 2021, 5:24am UTC](https://discuss.elastic.co/t/kibana-scripted-field-not-able-to-parse-the-string-to-double-int/279590/1 "2021-07-26T05:24:44Z")

</div>

I am getting one weired error.

I have field called no\_of\_scanned value which is String in Kibana

The data look like 1234 4567 etc

I cant do some aggregation so trying to convert this into int/double . SO I created a scripted field and select the type as number .

Here is my painless script :

```auto
return Double.parseDouble(doc['no_of_scanned'].value)

```

I am expecting an double to be returned .

But the result in console is looking like below.

```auto
[
{
  _id:"some randomid of elastic",
   zzz : [1898]

},
..
..
]

zzz is my scripted field. 

```

Please let me know why zzz value is surrounded by . I want just number to be returned.

---

<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 23, 2021, 5:25am UTC](https://discuss.elastic.co/t/kibana-scripted-field-not-able-to-parse-the-string-to-double-int/279590/2 "2021-08-23T05:25:35Z")

</div>

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