# Scripted field as string combined with a number

**URL:** https://discuss.elastic.co/t/scripted-field-as-string-combined-with-a-number/152249
**Category:** Elasticsearch
**Created:** [October 12, 2018, 1:37pm UTC](https://discuss.elastic.co/t/scripted-field-as-string-combined-with-a-number/152249 "2018-10-12T13:37:33Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![John\_Morrison](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_morrison/32/107691_2.png) [@John\_Morrison](https://discuss.elastic.co/u/John_Morrison)
#### Post date: [October 12, 2018, 1:37pm UTC](https://discuss.elastic.co/t/scripted-field-as-string-combined-with-a-number/152249/1 "2018-10-12T13:37:33Z")

</div>

doc['chrom.keyword'].value + ':' + ' ' + doc['start'].value + ' ' + doc['alt.keyword'].value + ' / ' + doc['ref.keyword'].value

chrom=string = chr1  
start=double = 43814975  
alt=string = C  
ref=string = T

scripted field is a string =  
chrom\_pos\_alt ￼= ￼ ￼ chr1: 4.3814975E7 C / T

When it should be = chr1: 43814975 C / T

How do I get that number to be "as is" instead of 4.3814975E7

Cheers,

John

---

<div class="post-metadata">

### Author: ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)
#### Post date: [October 14, 2018, 7:08pm UTC](https://discuss.elastic.co/t/scripted-field-as-string-combined-with-a-number/152249/2 "2018-10-14T19:08:40Z")

</div>

The scientific notation is exactly how the float value "is". If you don't care about potential data loss, you could cast to a long. Additionally, you could cast to a double, but there would still be the possibility of the same notation for other values (and I'm not positive double would not use that notation for your current value).

---

<div class="post-metadata">

### Author: ![John\_Morrison](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/john_morrison/32/107691_2.png) [@John\_Morrison](https://discuss.elastic.co/u/John_Morrison)
#### Post date: [October 26, 2018, 12:20pm UTC](https://discuss.elastic.co/t/scripted-field-as-string-combined-with-a-number/152249/3 "2018-10-26T12:20:48Z")

</div>

Thanks Ryan.

---

<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: [November 23, 2018, 12:20pm UTC](https://discuss.elastic.co/t/scripted-field-as-string-combined-with-a-number/152249/4 "2018-11-23T12:20:52Z")

</div>

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