Skip to content

Commit

Permalink
Bugfix: Allow leading + and - for number parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
peterb180369 committed Dec 2, 2019
1 parent 455268b commit 0d9be9d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion BXSwiftUtils/Strings/Numeric+Localized.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ extension String
var allowedChars = CharacterSet.decimalDigits
allowedChars.insert(charactersIn:decimalSeparator)
allowedChars.insert(charactersIn:groupingSeparator)

allowedChars.insert(charactersIn:"+-")

let illegalChars = allowedChars.inverted

return self.components(separatedBy:illegalChars).joined(separator:"")
Expand Down

0 comments on commit 0d9be9d

Please sign in to comment.