4
Stepper(value: $year, in: 2018...2025){Text("Year: \(year)")}

Displays as Year: 2.200 thousand-point with the thousand-point.

How can this thousand-point be avoided?

pawello2222
  • 46,897
  • 22
  • 145
  • 209
mica
  • 3,898
  • 4
  • 34
  • 62

2 Answers2

3

Instead of String interpolation:

Text("Year: \(year)")

Use String initialiser:

Text("Year: \(String(year))")
pawello2222
  • 46,897
  • 22
  • 145
  • 209
1

You can use alternate constructor for Text:

Text(verbatim: "Year: \(year)")

demo

Asperi
  • 228,894
  • 20
  • 464
  • 690