# Create new field value is incorrect

**URL:** https://discuss.elastic.co/t/create-new-field-value-is-incorrect/326912
**Category:** Elasticsearch
**Created:** [March 3, 2023, 7:02am UTC](https://discuss.elastic.co/t/create-new-field-value-is-incorrect/326912 "2023-03-03T07:02:06Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![ikonrao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ikonrao/32/117995_2.png) [@ikonrao](https://discuss.elastic.co/u/ikonrao)
#### Post date: [March 3, 2023, 7:02am UTC](https://discuss.elastic.co/t/create-new-field-value-is-incorrect/326912/1 "2023-03-03T07:02:06Z")

</div>

Hi,

I have a field which has value in seconds.

I need to view it in hours. I used create new field and used script to convert it into hours.

What i have observed is it is not able to take decimal values. For example, if the value in seconds is 600, the script convert it into 0.00 hour instead of 0.16 hour.

Does anyone has idea what needs to be done to get exact value

---

<div class="post-metadata">

### Author: ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)
#### Post date: [March 7, 2023, 10:54pm UTC](https://discuss.elastic.co/t/create-new-field-value-is-incorrect/326912/2 "2023-03-07T22:54:34Z")

</div>

It'd be great if you could share the code that you are using here so we can see what is happening and try to replicate it.

---

<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 4, 2023, 10:54pm UTC](https://discuss.elastic.co/t/create-new-field-value-is-incorrect/326912/3 "2023-04-04T22:54:41Z")

</div>

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