DEV Community

Discussion on: Controlled number input with Floats in Elm

Collapse
 
milesfrain profile image
milesfrain

There's a bug where you cannot enter numbers with any zeros after the decimal point. For example, typing 1.05 becomes 15.

This can be fixed by changing:

PriceField (Just price) _ ->
    toString price

to:

PriceField (Just _) price ->
    price

Here's a link to the code with that fix and updated to elm 0.19
ellie-app.com/6p5jwch2pYpa1

Collapse
 
joanllenas profile image
Joan Llenas Masó

Good catch @milesfrain ,
Do you mind if I update the post with the bugfix + the 0.19 code?
Cheers!

Collapse
 
milesfrain profile image
milesfrain

Feel free to update the post with those code changes