@swift-5.4.3import Foundation import CoreFoundation let numberFormatter: NumberFormatter = { let f = NumberFormatter() f.numberStyle = .decimal f.usesGroupingSeparator = true return f }() print(numberFormatter.string(from: .init(value: 1000)))(edited)