Search code examples
swiftswiftuistepper

SwiftUI Stepper puts "." in Integers


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?


Solution

  • You can use alternate constructor for Text:

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

    demo