The bug was that that a user couldn't enter numbers of the form '1.00' or '0.003'. This is because the component was using the buyout value directly as the value to display.
I switched things around so that the component uses a state variable to track the display value - while still updating the actual value for the buyout price as before.
I had to do some work to make sure the display value updated correctly when switching the units is the only place where this got a bit convoluted. Could be less hardcoded, but I think it's fine for now since we wouldn't ever support more than three types of units.
I also made the default price for the buyout component always 0.
This fixes #69
The bug was that that a user couldn't enter numbers of the form '1.00' or '0.003'. This is because the component was using the buyout value directly as the value to display.
I switched things around so that the component uses a state variable to track the display value - while still updating the actual value for the buyout price as before.
I had to do some work to make sure the display value updated correctly when switching the units is the only place where this got a bit convoluted. Could be less hardcoded, but I think it's fine for now since we wouldn't ever support more than three types of units.
I also made the default price for the buyout component always 0.