Scripted field as string combined with a number

(John) #1

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



(Ryan Ernst) #2

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).