Keeping a running total for a field

Can anyone point me in the right direction please. Can't find the procedure I am after. I just want a field to keep a running total for a list containing transactions for purchases. The field is ,

@State private var amount = 0.0

and in the UI appears as

TextField("Enter amount...", value: $amount, format: .currency(code: "USD"))

Thanks for any assistance.