struct ContentView: View { // MARK: Properties private var amount: Double = 0.00 private var currencyFormatter: NumberFormatter = { let f = NumberFormatter() f.numberStyle = .currency return f }() // MARK: Body var body: some View { HStack { Text(currencyFormatter.string(from: NSNumber(value: amount)) ?? "0.00") } } }