Mercurial > public > simoleon
diff Simoleon/Helpers/SubscribeButton.swift @ 82:3133bf6f6deb
Implemented Unit Testing
author | Dennis Concepción Martín <dennisconcepcionmartin@gmail.com> |
---|---|
date | Sun, 01 Aug 2021 10:30:10 +0100 |
parents | c7b6249ab745 |
children |
line wrap: on
line diff
--- a/Simoleon/Helpers/SubscribeButton.swift Sat Jul 31 23:44:45 2021 +0100 +++ b/Simoleon/Helpers/SubscribeButton.swift Sun Aug 01 10:30:10 2021 +0100 @@ -91,11 +91,10 @@ formatter.locale = locale formatter.numberStyle = .currency - if let formattedAmount = formatter.string(from: amount as NSNumber) { - return formattedAmount - } else { - return "\(amount)\(locale.currencySymbol!)" - } + // It won't fail. Check unit test + let formattedAmount = formatter.string(from: amount as NSNumber)! + + return formattedAmount } }