# Float types with inputs?

**URL:** <https://discourse.elm-lang.org/t/float-types-with-inputs/6316>\
**Category:** Learn\
**Created:** [September 29, 2020, 1:04am UTC](https://discourse.elm-lang.org/t/float-types-with-inputs/6316 "2020-09-29T01:04:29Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Sidney](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.elm-lang.org/sidney/32/3290_2.png) [@Sidney](https://discourse.elm-lang.org/u/Sidney)\
**Post date:** [September 29, 2020, 4:13am UTC](https://discourse.elm-lang.org/t/float-types-with-inputs/6316/2 "2020-09-29T04:13:07Z")

</div>

Generally, you will want to store the exact input in the model (as a string). When you want to display an error message (perhaps on field blur, or maybe only when submitting the form), you would run a validation function that returns `Result Float ValidationError` or a type like that.

I’ve used [hecrj/composable-form](https://package.elm-lang.org/packages/hecrj/composable-form/latest/) in the past, which does a great job of abstracting a lot of this (although it might be a bit complex for a small project).

---

_[View the full topic](https://discourse.elm-lang.org/t/float-types-with-inputs/6316)._
