diff --git a/.jazzy.yaml b/.jazzy.yaml index 25c1142..bbfe379 100644 --- a/.jazzy.yaml +++ b/.jazzy.yaml @@ -1,7 +1,7 @@ author_name: Daniel Thorpe author_url: http://danthorpe.me module_name: Money -module_version: 1.6.1 +module_version: 1.6.2 github_url: https://github.com/danthorpe/Money readme: README.md podspec: Money.podspec @@ -35,34 +35,11 @@ custom_categories: - _MoneyCoder - Money - - name: Foreign Exchange - children: - - MoneyPairType - - FXProviderType - - FXLocalProviderType - - FXRemoteProviderType - - CurrencyMarketTransactionType - - CryptoCurrencyMarketTransactionType - - FXQuote - - FXQuoteCoder - - FXTransaction - - FXTransactionCoder - - FXError - - FXRemoteProvider - - Yahoo - - OpenExchangeRatesAppID - - _OpenExchangeRates - - _ForeverFreeOpenExchangeRates - - CurrencyMarketTransactionKind - - name: Bitcoin children: - BitcoinCurrencyType - BTC - XBT - - CEXSupportedFiatCurrencyType - - CEXBuy - - CEXSell - name: Pay children: diff --git a/CHANGELOG.md b/CHANGELOG.md index 4cb74d7..6ce80a0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.6.2 +1. [[MNY-45](https://github.com/danthorpe/Money/pull/45)]: Fixes a serious bug where `Money` did not have the correct currency scale. + # 1.6.1 1. [[MNY-42](https://github.com/danthorpe/Money/pull/42)]: Removes all the example projects to [danthorpe/Examples](https://github.com/danthorpe/Examples). This is done mostly to avoid an issue where Carthage attempts to build all Xcode projects it can find in a repository. 2. [[MNY-43](https://github.com/danthorpe/Money/pull/43)]: Switch the code coverage reporting tool to [Coveralls](https://coveralls.io/github/danthorpe/Money), and got the coverage back to 100%. diff --git a/Money.podspec b/Money.podspec index 117830e..d99cc9e 100644 --- a/Money.podspec +++ b/Money.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "Money" - s.version = "1.6.1" + s.version = "1.6.2" s.summary = "Swift types for working with Money." s.description = <<-DESC @@ -15,7 +15,7 @@ Pod::Spec.new do |s| s.author = { "Daniel Thorpe" => "@danthorpe" } s.source = { :git => "https://github.com/danthorpe/Money.git", :tag => s.version.to_s } s.module_name = 'Money' - s.documentation_url = 'http://docs.danthorpe.me/money/1.6.1/index.html' + s.documentation_url = 'http://docs.danthorpe.me/money/1.6.2/index.html' s.social_media_url = 'https://twitter.com/danthorpe' s.requires_arc = true s.ios.deployment_target = '8.0' diff --git a/Money/Shared/Currency.swift b/Money/Shared/Currency.swift index 86ade9f..c7590b5 100644 --- a/Money/Shared/Currency.swift +++ b/Money/Shared/Currency.swift @@ -249,7 +249,9 @@ public struct Currency { let symbol = locale.currencySymbol let fmtr = NSNumberFormatter() + fmtr.numberStyle = .CurrencyStyle fmtr.locale = locale + fmtr.currencyCode = code let scale = fmtr.maximumFractionDigits self.init(code: code, scale: scale, symbol: symbol) diff --git a/Supporting Files/Money.xcconfig b/Supporting Files/Money.xcconfig index 50d96f8..af74a7d 100644 --- a/Supporting Files/Money.xcconfig +++ b/Supporting Files/Money.xcconfig @@ -6,7 +6,7 @@ // // -MONEY_VERSION = 1.6.1 +MONEY_VERSION = 1.6.2 APPLICATION_EXTENSION_API_ONLY = YES INFOPLIST_FILE = $(SRCROOT)/Supporting Files/Info.plist diff --git a/Tests/Shared/MoneyTests.swift b/Tests/Shared/MoneyTests.swift index 2089453..e1d603b 100644 --- a/Tests/Shared/MoneyTests.swift +++ b/Tests/Shared/MoneyTests.swift @@ -250,6 +250,7 @@ class MoneyDescriptionTests: MoneyTests { override func setUp() { super.setUp() + money = 3.99 gbp = 100 usd = 99 cad = 102.01 @@ -259,6 +260,10 @@ class MoneyDescriptionTests: MoneyTests { btc = 0.002_007 } + func test__money_description() { + XCTAssertEqual(money.description.endIndex, money.description.rangeOfString("3.99")?.endIndex) + } + func test__gbp_description() { XCTAssertEqual(gbp.currencyCode, "GBP") XCTAssertEqual(gbp.currencySymbol, "£")