# Unable to Map Float Fields to Double Using Dynamic Templates in Elasticsearch

**URL:** <https://discuss.elastic.co/t/unable-to-map-float-fields-to-double-using-dynamic-templates-in-elasticsearch/372316>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-security, elastic-stack-alerting\
**Created:** [December 23, 2024, 9:14am UTC](https://discuss.elastic.co/t/unable-to-map-float-fields-to-double-using-dynamic-templates-in-elasticsearch/372316 "2024-12-23T09:14:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SalehEska](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/saleheska/32/121805_2.png) [@SalehEska](https://discuss.elastic.co/u/SalehEska)\
**Post date:** [December 23, 2024, 9:14am UTC](https://discuss.elastic.co/t/unable-to-map-float-fields-to-double-using-dynamic-templates-in-elasticsearch/372316/1 "2024-12-23T09:14:32Z")

</div>

When attempting to map `float` fields to `double` using dynamic templates in Elasticsearch, I've encountered an issue where the template does not work when `match_mapping_type` is set to `float`. While the template is successfully created for other types, such as `long`, it fails for `float`.

I am looking for a workaround or solution to apply this mapping for `float` types to `double` in dynamic templates. The reason I’m trying to do this is that, when I search for a `float` value of 9 digits, the results are not accurate; it seems to ignore the last two digits.
