Skip to content

Currency 0.3.0

Pre-release
Pre-release
Compare
Choose a tag to compare
@Mordil Mordil released this 21 Jan 06:14
· 41 commits to master since this release
ac44099

Major

  • AnyCurrency storage is now "minorUnits" 44425d8
    • AnyCurrency now uses Int64 "minorUnits" as the underlying storage instead of Foundation.Decimal "exactAmount"
    • AnyCurrency.roundedAmount is now amount
    • AnyCurrency.init(minorUnits:) is now .init(exactly:)
      • This is now required by the AnyCurrency protocol
  • _CurrencyImplementation has been renamed and made public as CurrencyProtocol d4fcba8
    • This is the protocol to reference as a generic constraint, while AnyCurrency can be used as a type-erased existential

Minor

  • AnyCurrency now has a "minorUnits" property 44425d8
  • AnyCurrency now has two methods for distribution algorithms 46f75f0
    • distributedEvenly(intoParts:)
    • distributedProportionally(between:)
  • AnyCurrency now has an inverse computed property for getting the opposite signed value 46f75f0
  • Sequences with AnyCurrency elements now has a inlined mapping sum(_:) overload b898bb4

Patch

  • The Currency module should now be able to be embedded in iOS apps 46aa110
  • sum and sum(where:) should now property be O(n) and inlinable for more performance 71285fe

Misc

  • Tests are now run against Swift 5 in addition to 5.1