title: How to make TextField align right (trailing)
body: <p>I am trying to have the value of a <strong>TextField</strong> displayed with trailing alignment. </p>
  
  <p>As you can see the value <em>34.3</em> is display with leading alignment.</p>
  
  <p>I am sure I am missing something obvious but I can't figure out what. Any ideas?</p>
  
  <pre><code>@State private var endwert = 34.3
  
  var numberFormatter: NumberFormatter {
      let formatter = NumberFormatter()
      formatter.numberStyle = .decimal
      formatter.locale = Locale.current
      return formatter
  }
  
  ...
  
  HStack {
  
    Text("Endwert")
      .frame(width: nil, height: nil, alignment: .topTrailing)
      .background(Color .green)
  
    Spacer()
  
    TextField($endwert, formatter: numberFormatter)
      .background(Color.yellow)
      .frame(width: nil, height: nil, alignment: .trailing)
  
    Text("m2")
  }
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/lpnQu.png" rel="noreferrer"><img src="https://i.stack.imgur.com/lpnQu.png" alt="wich looks like this"></a></p>