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 moved to money/tagged-literals.
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:
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.
BREAKING CHANGES:
Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close