Skip to content

Releases: randomseed-io/bankster

1.2.5

02 May 22:05
1.2.5
Compare
Choose a tag to compare
  • Monetary implementation for maps is more restrictive when registry is passed as an
    argument. Previously maps were causing some functions to create ad hoc
    currencies, now the :id key is used to get the existing currency from a registry.
    This is in line with the protocol's guidelines. Affected functions: currency/unit,
    currency/of-id.

  • Monetary implementation for Currency objects is now fulfilling protocol
    specification, making ID-only look-ups. Affected functions: currency/unit,
    currency/of-id.

  • Monetary implementation for keywords now falls back to currency code look-up even
    if the given identifier is not namespace-qualified. Affected functions:
    currency/unit, currency/present? It fixes the chicken or the egg problem during
    registry building.

  • Functions currency/add-countries, currency/remove-localized-properties,
    currency/add-localized-properties, currency/add-weighted-code and currency/update
    are now more strict and require currency ID to be given (not currency code).

BREAKING CHANGES:

  • Low-level function currency/add-weighted-currency renamed to
    currency/add-weighted-code.

1.2.4

18 Apr 00:27
1.2.4
Compare
Choose a tag to compare
  • Added money/data-readers and money/code-readers constants.

  • Added data_readers_edn.clj (with generator in importer/readers-export) containing
    data readers for parsing EDN files.

  • Fixed a bug causing registry to not be properly set in currency/with-registry and
    registry/with.

  • Added fs/get-resource utility function.

BREAKING CHANGES:

  • Data readers for tagged literals are split into code and data related handlers:

    • Functions currency/code-literal and money/code-literal are now emitting Clojure
      forms that are to be evaluated to produce Currency and Money objects.

    • Functions currency/data-literal and money/data-literal are now returning Currency
      and Money objects.

    • Tagged literal handlers (for both Clojure code and data) can now be controlled by
      the environment (e.g. dynamic variables for setting alternate registry or
      rounding mode during parsing).

    • Constant bankster/tagged-literals removed.

1.2.3

16 Apr 09:39
1.2.3
Compare
Choose a tag to compare
  • Fixed issue with data-readers file visibility by adding a copy to resources directory.

1.2.2

16 Apr 08:50
1.2.2
Compare
Choose a tag to compare
  • Added io.randomseed.bankster/data-readers map to expose tagged literal handlers.

1.2.1

14 Apr 22:10
1.2.1
Compare
Choose a tag to compare
  • Fixed a bug causing money/of-registry to not rescale amounts.

1.2.0

13 Apr 10:13
1.2.0
Compare
Choose a tag to compare

1.2.0 (2021-04-13)

  • Function money/div-rem renamed to money/rem and improved to behave like div in
    terms of accepted argument types, rounding and rescaling.

  • Added function money/abs.

  • Added aliases: money/+, money/-, money/*, money//, money/min, money/max.

  • Added aliases: money/>, money/>=, money/<, money/<=, money/=, money/==.

  • Added aliases: money/pos?, money/neg?, money/zero?.

  • Conversion functions scale/->int, scale/->long, scale/->double, scale/->float,
    scale/to-plain-string, scale/to-clojure-string, scale/to-symbol,
    scale/to-clojure-symbol are now using scale/amount to get the actual amount of the
    given scalable instead of expecting BigDecimal values.

BREAKING CHANGES:

  • Function money/pos now returns its argument. Use money/abs to get the absolute
    value.

1.1.3

12 Apr 22:07
1.1.3
Compare
Choose a tag to compare
  • Dependencies updated.

1.1.2

12 Apr 22:06
1.1.2
Compare
Choose a tag to compare
  • Monetary protocol methods are now more strict about the origin of currency
    if a registry is given (by-ID resolving and getting from a registry happens
    even for Currency objects).

  • Unary variants of money/div and money/div-scaled are now able to take money as an
    argument (common operation when recalculating exchange rates).

  • Protocol method implementations of money/value short-circuit on nil given as an
    amount.

  • Added functions: money/auto-scaled?, money/of-registry and money/on-amount.

  • Fixed a bug causing division and multiplication of auto-scaled currencies to
    rescale results to latest scales of the amounts instead of performing scale-free
    calculations.

  • Added stripping of trailing zeros before performing scale-free divisions – causes
    non-terminal decimal expansion to end after more optimal (lesser) number of decimal
    digits.

1.1.1

26 Mar 23:57
1.1.1
Compare
Choose a tag to compare

Improved rounding mode parsing in macros.

1.1.0

25 Mar 22:48
1.1.0
Compare
Choose a tag to compare
  • Added currency/update for updating currencies with additional data preservation
    (localized properties, countries, etc.).
  • Added money/cast for casting monetary amounts across currencies
    (different or slightly different, e.g. sourced in another registries).
  • Added scale/to-clojure-string, scale/to-symbol, scale/to-clojure-symbol.
  • Added money/->symbol, money/->clojure-symbol, money/->double, money/->float.
  • Improved money/value to be more polymorphic (currency argument).
  • Improved conversion functions: scale/->int, scale/->long, scale/->float, scale/->double.
  • Type hinting improved in multiple functions and protocol methods.

BREAKING CHANGES:

  • Conversion functions now have different arities:
    scale/->int, scale/->long, scale/->float, scale/->double.
  • Function scale/to-plain-string is now converting decimals to plain strings
    without adding M suffix when there are too many digits. This functionality
    was moved to scale/to-clojure-string.