The best way to show a plus sign “+” before a decimal value with Swift 4 is to use the NumberFormatter class. You have to use the property “positivePrefix”. Assign a string value to this property to show when the value is a positive number.
let numberFormatter = NumberFormatter() numberFormatter.numberStyle = .decimal // Set defaults to the formatter that are common for showing decimal numbers numberFormatter.positivePrefix = "+" // Show + sign when the value is a positive number let myDouble = 1234567.89 let myFormattedDouble = numberFormatter.string(for: myDouble) # myFormattedDouble = +1234567.89