Skip to content

CurrencyField #4

@telcosolutions

Description

@telcosolutions

Problem #3
There is a problem in format in the view.
Try this:
var body: some View {

	HStack{
		Spacer()

// CurrencyField("test", value: Binding(
// get: {amount.map { NSDecimalNumber(decimal: $0) }
// }, set: { number in amount = number?.decimalValue
// }))

		Text("Hello World")
		Spacer()
			Button(action: {
				if amount == nil { amount = 0.0}
				amount = Decimal(1) + amount!
			}, label: {
				HStack {
					Text("EXec")
						.font(.system(size: 30))
				}
			})
		Spacer()
	}

}

The 2 fields are equal distance from the edge and each other. Then comment out the Text field and uncomment the CurrencyField. The 2 fields are on the edge of the view.

George

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions