converting a text field string to a double field

There is a initializer which can take a Double and a format description , init(_:value:format:prompt:).

TextField("Weight", value: $mainViewVM.weightEntry.weight, format: .number.precision(.fractionLength(1)))

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top