New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I initialise this textField with a pre-populated value? #11
Comments
Fixed them both. Thanks! |
Excellent, thank you for the quick fix. The only other question I have is that I would like for it to always display in the $0.00 format, however if the value is a whole number it drops the decimal points. Is there an option to force it to always display in the same format. I'm looking at a list of values and it makes them look odd if some are $0 format and others are $0.00 format. in the mean time I have changed the currencyFormat extension to this which forces it to always be $0.00 format:
|
Checkout the latest release, have added an option |
Nice thanks for the quick turn around again! 👍 |
Looking at the demo app in CurrencyTextFieldDemoView if I change the value from 0.0 to 4.5
@State private var value: Double? = 4.5
I would expect the app to launch with a value of £4.50 in the text filed however, when run, the field still only shows the Placeholder of 'Amount'. If I type nothing but click the "Print" button with it still showing the Placeholder it then prints the value it was init'd with:
Optional(4.5)
So the value is there, its just not being displayed.
The other behaviour I think is odd, is that if I set the field to say 2.1 when I dismiss the keyboard I would expect that to re-format as £2.10 however its still displays as £2.1 which is obviously an improper currency format.
Thanks
Plasma
The text was updated successfully, but these errors were encountered: