diff --git a/Makefile b/Makefile index 9ceed4e..bc7c6a6 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ APPNAME = "bankster" -VERSION = "1.2.11" +VERSION = "1.2.12" .PHONY: watch default docs deploy test test-clj sig jar pom clean tag diff --git a/NEWS.md b/NEWS.md index dbd16a1..fd672f6 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,9 @@ # History of Bankster releases +## 1.2.12 (2021-07-18) + +- Type hinting and assertion tests improved in money/compare and money/compare-amount. + ## 1.2.10, 1.2.11 (2021-07-13) - Fixed a bug which caused rounding mode parsing to not make use of evaluated results diff --git a/README.md b/README.md index 4afd3ac..9b1aa01 100644 --- a/README.md +++ b/README.md @@ -35,14 +35,14 @@ To use Bankster in your project, add the following to dependencies section of `project.clj` or `build.boot`: ```clojure -[io.randomseed/bankster "1.2.11"] +[io.randomseed/bankster "1.2.12"] ``` For `deps.edn` add the following as an element of a map under `:deps` or `:extra-deps` key: ```clojure -io.randomseed/bankster {:mvn/version "1.2.11"} +io.randomseed/bankster {:mvn/version "1.2.12"} ``` Additionally, if you want to utilize specs and generators provided by the Bankster @@ -553,7 +553,7 @@ Stellar Lumens are cool too: ## Why? -In one of my personal projects I needed to support both ISO-standardized and custom +In one of my personal projects I needed support for both, ISO-standardized and custom currencies. My first try was Money (by Clojurewerkz), which is quite mature library based on Java's Joda Money. However, I needed cryptocurrencies support, and I mean all of them, including those having non-standard codes (like `DASH`). diff --git a/bankster.jar.asc b/bankster.jar.asc index 287bc1a..8d5d4d6 100644 --- a/bankster.jar.asc +++ b/bankster.jar.asc @@ -1,17 +1,17 @@ -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org -iQIzBAABCAAdFiEElzhGBxSaMDOq9Z/XNjF6dNg249AFAmDtawcACgkQNjF6dNg2 -49C2oRAAwWxbQEyc89qtqhBrAczpYapxM/Ig6sI4+XrGA+xePrMq+iDgHo57yFUm -CVz++lv6zstxadQNNEgwfn9RRwxj6QywK9rPX3iMHNnIvAHenN5k6BRsOVtiHbIi -utgPfvRAxAy20Duier1q0WyP68QP9x1kPOZfi5YEEINTJuu4e+LGJLFnW2cdmC+F -oB6yLkgVxyu/UrpgaxqnSCjiXAVhjtlh6hpaALRChxXTO0SpW5jnvAvkXveMd0uy -NhAvdlZL6KqqJGRuAXzugq7UuUTLCVwmzITvKxnKXtX53qddM6gUAIEYQ4fN1kSh -t4rlmppJz6jTTTI+OItNPuTlC4hscpvVkYQNvMtxdMdI1OPOdCVnwAjtBR+E6C9f -Ud1LUKidqsoLQZ9rIV0ObUkBe3TDMh1Qb95arYmOeVi2vvEr/TJdCMK5Q6QxR7U1 -01zWgTiMhhxCSHOVu4+qrP4KVqXr9PeZ6sb0LPd86OWNPlGBX6Kw1xbg3d/i43GI -uo12cEJ/L7z4BKYxDBRFDYs46tj8+BUJSOBwLIFbp9xYILCBSYmTng575wfH72Ga -kGrvDdJlJK8Pb0vY/hnahFs0UcVWfPabpGKvzr9kRsfrAPqzQwTHAxS3S0k7BrwK -SW3AVAMWB01sg1g0qP/oDNWzp7TGLbTFatD9Y3Rf+t56/8y+oaU= -=+q9v +iQIzBAABCAAdFiEElzhGBxSaMDOq9Z/XNjF6dNg249AFAmD0YcQACgkQNjF6dNg2 +49CplBAAw6L13iFZnfXHY6WrWa/syG+abEwlTepSfU7wdsWdfwVTqHfjKxh2nS+x +G6QK8PXY+yvFX+jADVHSRiq9GyWtacyDHndOOLEOjKo13d6Hlj81KWYtyfGnFyF3 +ou+i/DtI4wx9k0/eIGehc6I2094zupLQrGqSrSidp7NFkxiTTNl7K5ReLwIPA2p1 +aCatWOsV2wauLXFk+8mjjd7Dq8A4ofIXX6FH+Om95M/2HeKg7OIFXW2xM6X6R3ed +XretGp5IimaivxnAUoqOcawPJDfnCN/ZghqsEWaIVh12TYFDo6oFfn3WHVYCPEFy +uXWPA9AUutN/gokOcp5Vos10dZluArbPbpvGJEIdx3Yzl6KLS/ZX+hXejiCJnzO5 +cOT6ixucEqWfA6UZtQ+pIuh+EdAYZmVoX6z5VDncWvLi5itfr0oVrXq2o2YmFpjI +UdgLTWQmgdpKl4cUvZG5AmFAxuPwQlVUElyFnouzo9jz4ri3uOZgAxWZfCjtSvbW +Dch/ruUxo0D8ChVspyqQj0ui+wX9d7FJgCLm2d8WGnL1SkQlDPd0MQHzlFjEZTT/ +xDy4Ws8EypzD15NpiSYVH6kKYVGM0I6oy8gs4lxSYGm+jxbO9oPqFDXDrhBKeY0d +LAbOSaFEghGwEJrCsCF0hcoDiBvd25Q+UEusfxKfWrfWhi8stCQ= +=vtHA -----END PGP SIGNATURE----- diff --git a/deps.edn b/deps.edn index 57b4cdb..25bf084 100644 --- a/deps.edn +++ b/deps.edn @@ -96,7 +96,7 @@ :description "Money Creation Made Easy" :license "GNU Lesser General Public License 3.0" :package io.randomseed/bankster - :version "1.2.11" + :version "1.2.12" :output-path "docs" :source-uri "https://github.com/randomseed-io/bankster/blob/{version}/{filepath}#L{line}" :metadata {:doc/format :markdown} diff --git a/doc/10_introduction.md b/doc/10_introduction.md index ffd220a..613607e 100644 --- a/doc/10_introduction.md +++ b/doc/10_introduction.md @@ -35,14 +35,14 @@ To use Bankster in your project, add the following to dependencies section of `project.clj` or `build.boot`: ```clojure -[io.randomseed/bankster "1.2.11"] +[io.randomseed/bankster "1.2.12"] ``` For `deps.edn` add the following as an element of a map under `:deps` or `:extra-deps` key: ```clojure -io.randomseed/bankster {:mvn/version "1.2.11"} +io.randomseed/bankster {:mvn/version "1.2.12"} ``` Additionally, if you want to utilize specs and generators provided by the Bankster @@ -553,7 +553,7 @@ Stellar Lumens are cool too: ## Why? -In one of my personal projects I needed to support both ISO-standardized and custom +In one of my personal projects I needed support for both, ISO-standardized and custom currencies. My first try was Money (by Clojurewerkz), which is quite mature library based on Java's Joda Money. However, I needed cryptocurrencies support, and I mean all of them, including those having non-standard codes (like `DASH`). diff --git a/docs/10_introduction.html b/docs/10_introduction.html index 82a2a0f..cde19f4 100644 --- a/docs/10_introduction.html +++ b/docs/10_introduction.html @@ -1,6 +1,6 @@ -Introduction

Introduction

+Introduction

Introduction

Money Creation Made Easy!

Bankster on Clojars Bankster on cljdoc CircleCI

Clojure library to operate on monetary units with cryptocurrencies and custom currencies support.

@@ -26,10 +26,10 @@

Features

Installation

To use Bankster in your project, add the following to dependencies section of project.clj or build.boot:

-
[io.randomseed/bankster "1.2.11"]
+
[io.randomseed/bankster "1.2.12"]
 

For deps.edn add the following as an element of a map under :deps or :extra-deps key:

-
io.randomseed/bankster {:mvn/version "1.2.11"}
+
io.randomseed/bankster {:mvn/version "1.2.12"}
 

Additionally, if you want to utilize specs and generators provided by the Bankster you can use (in your development profile):

org.clojure/spec.alpha {:mvn/version "0.2.176"}
@@ -446,7 +446,7 @@ 

Deum Ethereum

I write Free Software for fun. If you are finding it useful and you are the Ether fan too, here it is: 0x2Bed4D2d9240F9fB321bC0194222A4888F62dd0d.

Stellar Lumens are cool too: GBMUQ6U6334Y5HWF3XGMCRQZKVMFDCSX4YADEVZO7ZXIBDJDXXX2BSME.

Why?

-

In one of my personal projects I needed to support both ISO-standardized and custom currencies. My first try was Money (by Clojurewerkz), which is quite mature library based on Java’s Joda Money. However, I needed cryptocurrencies support, and I mean all of them, including those having non-standard codes (like DASH).

+

In one of my personal projects I needed support for both, ISO-standardized and custom currencies. My first try was Money (by Clojurewerkz), which is quite mature library based on Java’s Joda Money. However, I needed cryptocurrencies support, and I mean all of them, including those having non-standard codes (like DASH).

First I tried to modify Money and work-around this limitation by imitating such currencies with an additional map translating custom codes into standardized ones. Then I looked at Joda Money to see that the important classes are marked as final and the support for currencies is limited to the “official” ones.

License

Copyright © 2021 Paweł Wilk

diff --git a/docs/20_data_structures.html b/docs/20_data_structures.html index 90a3b59..79cee99 100644 --- a/docs/20_data_structures.html +++ b/docs/20_data_structures.html @@ -1,6 +1,6 @@ -Data Structures

Data Structures

+Data Structures

Data Structures

Currency

Currency is a record describing currency and having the following fields:

When choosing different currency, all parameters of a formatter are initially set to that currency. Additionally re-scaling may take place for the amount if scales are different.

The function assigned to the :currency-symbol-fn should take 3 arguments: currency, locale and registry.

-

It is advised to express locale using a keyword when huge amount of operations is expected.

has-country?

added in 1.0.0

(has-country? c)(has-country? c registry)

Returns true if the given currency has at least one country for which it is an official currency.

has-kind?

added in 1.0.0

(has-kind? c)(has-kind? c registry)

Returns true if the given currency has its kind defined.

has-numeric-id?

added in 1.0.0

(has-numeric-id? c)(has-numeric-id? c registry)

Returns true if the given currency has a numeric ID.

in-domain?

added in 1.0.0

(in-domain? ns c)(in-domain? ns c registry)

Returns true if the given currency has a domain set to the first given argument.

iso?

added in 1.0.0

(iso? c)(iso? c registry)

Returns true if the given currency is an official currency and its identifier is compliant with ISO standard. It is just a helper which checks if the :domain field of a currency equals :ISO-4217.

java

added in 1.0.0

(java currency)(java currency registry)

For ISO-standardized currency, returns corresponding java.util.Currency object.

kind

added in 1.0.0

(kind c)(kind c registry)(kind c locale registry)

Returns currency kind. It is a keyword which describes origin of its value. Currently known kinds are:

+

It is advised to express locale using a keyword when huge amount of operations is expected.

has-country?

added in 1.0.0

(has-country? c)(has-country? c registry)

Returns true if the given currency has at least one country for which it is an official currency.

has-kind?

added in 1.0.0

(has-kind? c)(has-kind? c registry)

Returns true if the given currency has its kind defined.

has-numeric-id?

added in 1.0.0

(has-numeric-id? c)(has-numeric-id? c registry)

Returns true if the given currency has a numeric ID.

in-domain?

added in 1.0.0

(in-domain? ns c)(in-domain? ns c registry)

Returns true if the given currency has a domain set to the first given argument.

iso?

added in 1.0.0

(iso? c)(iso? c registry)

Returns true if the given currency is an official currency and its identifier is compliant with ISO standard. It is just a helper which checks if the :domain field of a currency equals :ISO-4217.

java

added in 1.0.0

(java currency)(java currency registry)

For ISO-standardized currency, returns corresponding java.util.Currency object.

kind

added in 1.0.0

(kind c)(kind c registry)(kind c locale registry)

Returns currency kind. It is a keyword which describes origin of its value. Currently known kinds are:

  • :FIAT – legal tender issued by government or other authority
  • :FIDUCIARY - accepted medium of exchange issued by a fiduciary or fiduciaries
  • @@ -47,7 +47,7 @@
  • :COMMODITY - accepted medium of exchange based on commodities
  • :EXPERIMENTAL - pseudo-currency used for testing purposes.
-

The function may return nil if the currency is a no-currency. Locale argument is ignored.

kind-of?

added in 1.0.0

(kind-of? c kind)(kind-of? c kind registry)

Returns a kind of the given currency equals to the one given as a second argument.

localized-properties

added in 1.0.8

(localized-properties c)(localized-properties c registry)

Returns a map of localized properties for the given currency. Locale objects are translated back to their keyword representations.

localized-property

added in 1.0.0

(localized-property property currency-id)(localized-property property currency-id locale)(localized-property property currency-id locale registry)

Gets the localized property of a currency from the given registry and locale. If the registry is not given, the global one will be used. If the locale is not given, the default locale for the environment will be used. Locale can be expressed as a Locale object or any object which can be used to identify the locale (e.g. a keyword or a string).

+

The function may return nil if the currency is a no-currency. Locale argument is ignored.

kind-of?

added in 1.0.0

(kind-of? c kind)(kind-of? c kind registry)

Returns a kind of the given currency equals to the one given as a second argument.

localized-properties

added in 1.0.8

(localized-properties c)(localized-properties c registry)

Returns a map of localized properties for the given currency. Locale objects are translated back to their keyword representations.

localized-property

added in 1.0.0

(localized-property property currency-id)(localized-property property currency-id locale)(localized-property property currency-id locale registry)

Gets the localized property of a currency from the given registry and locale. If the registry is not given, the global one will be used. If the locale is not given, the default locale for the environment will be used. Locale can be expressed as a Locale object or any object which can be used to identify the locale (e.g. a keyword or a string).

Localized properties are maps keyed by currency identifiers, containing another maps keyed by locale objects. There is a special key :* which identifies default properties used when there are no properties in locale-keyed maps.

Let’s take a hypothetical entry of a registry database .cur-id->localized:

{:XXX {#object[java.util.Locale 0x3f5af72f "en_US"] {:symbol "$"}}
@@ -69,18 +69,18 @@
   
  • th_TH and th.
  • The third example renders ABC because there is an entry of :symbol in the default properties map under the key :*.

    -

    Please note that functions for getting particular properties may apply additional steps to obtain them. For instance, the display-name function will first call the localized-property and if it fails it will fall back to Java methods (if the currency is ISO-standardized). If that will fail too then it will return a currency code.

    map->new

    added in 1.0.0

    (map->new m)

    Creates new currency record from a map.

    Monetary

    protocol

    added in 1.0.0

    The Monetary protocol describes basic operations on currencies. It uses single dispatch to allow currencies to be expressed with different kinds of data (keywords, symbols, strings, native Currency objects etc.).

    members

    defined?

    added in 1.0.0

    (defined? id)(defined? id registry)

    Returns true if the given currency (identified by its ID) exists in a registry. If the registry is not given, the global one will be used, trying a dynamic registry bound to the registry/*default* first.

    id

    added in 1.0.0

    (id id)(id id registry)

    Returns a unique identifier of the given currency as a keyword. The currency can be expressed as a Currency object, a keyword, a string or any other type which is recognized by the unit protocol method.

    +

    Please note that functions for getting particular properties may apply additional steps to obtain them. For instance, the display-name function will first call the localized-property and if it fails it will fall back to Java methods (if the currency is ISO-standardized). If that will fail too then it will return a currency code.

    map->new

    added in 1.0.0

    (map->new m)

    Creates new currency record from a map.

    Monetary

    protocol

    added in 1.0.0

    The Monetary protocol describes basic operations on currencies. It uses single dispatch to allow currencies to be expressed with different kinds of data (keywords, symbols, strings, native Currency objects etc.).

    members

    defined?

    added in 1.0.0

    (defined? id)(defined? id registry)

    Returns true if the given currency (identified by its ID) exists in a registry. If the registry is not given, the global one will be used, trying a dynamic registry bound to the registry/*default* first.

    id

    added in 1.0.0

    (id id)(id id registry)

    Returns a unique identifier of the given currency as a keyword. The currency can be expressed as a Currency object, a keyword, a string or any other type which is recognized by the unit protocol method.

    The role of the default registry is advisory. If the registry argument is not given (or it is nil) and the dynamic variable io.randomseed.bankster.registry/*default* does not refer to a truthy value then the ID will be returned regardless of whether the currency exists in a registry, by simply converting it to a keyword or getting a field from a Currency object. Still, the default registry will be consulted to resolve possible currency code. For instance: if BTC is a currency code of a registered currency identified as :crypto/BTC then the resulting value for :BTC will be :crypto/BTC; but for :BLABLA (which does not exist in a registry) the resulting value will be :BLABLA.

    If a registry is given (or a dynamic registry is set) then trying to use a non-existing currency will cause an exception to be thrown.

    of-id

    added in 1.0.0

    (of-id id)(of-id id registry)

    Returns a currency object for the given ID and a registry. If the registry is not given, it will use the global one, but will first try a registry bound to the io.randomseed.bankster.registry/*default* dynamic variable (if it’s set).

    The currency is always taken from a registry (on a basis of its ID) even if a Currency object was given, with one exception: if a currency is passed and the second argument is explicitly set to nil then the object will be returned as is, without consulting the registry.

    present?

    added in 1.0.2

    (present? id)(present? id registry)

    Returns true if a currency of the given currency code or ID exists in a registry. If the registry is not given, the global one will be used, trying a dynamic registry bound to the registry/*default* first.

    same-ids?

    added in 1.0.0

    (same-ids? a b)(same-ids? a b registry)

    Returns true if two currencies have the same ID. If the registry is not given, it will use the global one, but will first try a dynamic registry bound to the io.randomseed.bankster.registry/*default* dynamic variable.

    unit

    added in 1.0.2

    (unit id)(unit id registry)

    Returns a currency object for the given ID or currency code. If the registry is not given, it will try a registry bound to the io.randomseed.bankster.registry/*default* dynamic variable and if it is not set (or is falsy value) it will use the global registry.

    If a Currency object is passed, it will be returned as is without consulting the registry, unless the registry is given (and not nil) or the dynamic registry is set. In this case the currency will be obtained from a registry on a basis of its ID extracted from the given object.

    If the registry is given (or dynamic registry is set) and the currency does not exist in a registry an exception will be thrown, regardless of whether a Currency object was passed or not.

    -

    Explicitly passing nil as a second argument when a Currency object is given can speed things up a bit in certain scenarios by bypassing dynamic variable check.

    name

    added in 1.0.0

    (name currency)(name currency locale)(name currency locale registry)

    Alias for display-name.

    name-native

    added in 1.0.0

    (name-native currency)(name-native currency registry)

    Alias for display-name-native.

    new

    (new id)(new id numeric-id)(new id numeric-id scale)(new id numeric-id scale kind)(new id numeric-id scale kind domain)(new id numeric-id scale kind domain weight)

    Alias for new-currency.

    new-currency

    added in 1.0.0

    (new-currency id)(new-currency id numeric-id)(new-currency id numeric-id scale)(new-currency id numeric-id scale kind)(new-currency id numeric-id scale kind domain)(new-currency id numeric-id scale kind domain weight)

    Creates new currency record from values passed as arguments.

    no-numeric-id

    added in 1.0.0

    Expresses the value of currency’s numeric ID which does not exist.

    nr

    added in 1.0.0

    (nr c)(nr c registry)(nr c locale registry)

    Returns currency numeric ID as a long number. For currencies without the assigned number it will return nil. Locale argument is ignored.

    ns

    (ns c)(ns c registry)(ns c locale registry)

    Alias for domain.

    ns-code

    added in 1.0.0

    (ns-code c)(ns-code c registry)(ns-code c locale registry)

    Returns a currency code as a string for the given currency object. If the currency identifier is namespaced the namespace will be used as a prefix and slash character as a separator. Locale argument is ignored.

    numeric

    (numeric c)(numeric c registry)(numeric c locale registry)

    Alias for nr.

    numeric-id

    (numeric-id c)(numeric-id c registry)(numeric-id c locale registry)

    Alias for nr.

    of

    macro

    added in 1.0.0

    (of currency)(of currency registry)

    Returns a currency for the given value by querying the given registry or a global registry, which may be shadowed by the value of registry/*default* (see registry/with or with-registry).

    of-country

    added in 1.0.0

    (of-country country-id)(of-country country-id registry)(of-country country-id locale registry)

    Returns a currency for the given country identified by a country ID (which should be a keyword). If there is no currency or country of the given ID does not exist, returns nil. Locale argument is ignored.

    official?

    (official? c)(official? c registry)

    Alias for iso?

    possible?

    added in 1.0.0

    (possible? c)(possible? c registry)

    Returns true if the given value is a possible currency representation. If the registry is not given, the global one is used. By possible representation we mean that it is a currency with a keyword identifier or any other data type which can be successfully converted into such using the registry provided.

    register

    added in 1.0.0

    (register registry currency)(register registry currency country-ids)(register registry currency update-mode?)(register registry currency country-ids update-mode?)(register registry currency country-ids localized-properties)(register registry currency country-ids localized-properties update-mode?)

    Adds a currency and optional, associated country mappings and/or localized properties to the given registry. Returns updated registry.

    +

    Explicitly passing nil as a second argument when a Currency object is given can speed things up a bit in certain scenarios by bypassing dynamic variable check.

    name

    added in 1.0.0

    (name currency)(name currency locale)(name currency locale registry)

    Alias for display-name.

    name-native

    added in 1.0.0

    (name-native currency)(name-native currency registry)

    Alias for display-name-native.

    new

    (new id)(new id numeric-id)(new id numeric-id scale)(new id numeric-id scale kind)(new id numeric-id scale kind domain)(new id numeric-id scale kind domain weight)

    Alias for new-currency.

    new-currency

    added in 1.0.0

    (new-currency id)(new-currency id numeric-id)(new-currency id numeric-id scale)(new-currency id numeric-id scale kind)(new-currency id numeric-id scale kind domain)(new-currency id numeric-id scale kind domain weight)

    Creates new currency record from values passed as arguments.

    no-numeric-id

    added in 1.0.0

    Expresses the value of currency’s numeric ID which does not exist.

    nr

    added in 1.0.0

    (nr c)(nr c registry)(nr c locale registry)

    Returns currency numeric ID as a long number. For currencies without the assigned number it will return nil. Locale argument is ignored.

    ns

    (ns c)(ns c registry)(ns c locale registry)

    Alias for domain.

    ns-code

    added in 1.0.0

    (ns-code c)(ns-code c registry)(ns-code c locale registry)

    Returns a currency code as a string for the given currency object. If the currency identifier is namespaced the namespace will be used as a prefix and slash character as a separator. Locale argument is ignored.

    numeric

    (numeric c)(numeric c registry)(numeric c locale registry)

    Alias for nr.

    numeric-id

    (numeric-id c)(numeric-id c registry)(numeric-id c locale registry)

    Alias for nr.

    of

    macro

    added in 1.0.0

    (of currency)(of currency registry)

    Returns a currency for the given value by querying the given registry or a global registry, which may be shadowed by the value of registry/*default* (see registry/with or with-registry).

    of-country

    added in 1.0.0

    (of-country country-id)(of-country country-id registry)(of-country country-id locale registry)

    Returns a currency for the given country identified by a country ID (which should be a keyword). If there is no currency or country of the given ID does not exist, returns nil. Locale argument is ignored.

    official?

    (official? c)(official? c registry)

    Alias for iso?

    possible?

    added in 1.0.0

    (possible? c)(possible? c registry)

    Returns true if the given value is a possible currency representation. If the registry is not given, the global one is used. By possible representation we mean that it is a currency with a keyword identifier or any other data type which can be successfully converted into such using the registry provided.

    register

    added in 1.0.0

    (register registry currency)(register registry currency country-ids)(register registry currency update-mode?)(register registry currency country-ids update-mode?)(register registry currency country-ids localized-properties)(register registry currency country-ids localized-properties update-mode?)

    Adds a currency and optional, associated country mappings and/or localized properties to the given registry. Returns updated registry.

    The optional country-ids argument should be a sequence of keywords (however, if a single keyword is given it will be converted to a single-element sequence) with country codes which should be associated with the given currency.

    The optional localized-properties argument should be a map of localized properties of the given currency. See the Data Structures documentation section for more information.

    -

    If the update mode is enabled then all of the current countries associated with the currency are removed and replaced with the provided ones. To simply add new countries, use add-countries. Also note that update mode removed localized properties so new one must be provided.

    register!

    added in 1.0.0

    (register! currency)(register! currency country-id-or-update?)(register! currency country-id localized-properties update?)

    Adds currency and (optional) country to the global registry. Returns updated registry. When the currency is nil, returns current state of the global, shared registry (but not a dynamic registry, even if it is set).

    remove-countries

    added in 1.0.0

    (remove-countries registry country-ids)

    Removes countries from the given registry. Also unlinks constrained currencies in proper locations. Returns updated registry.

    remove-countries!

    added in 1.0.0

    (remove-countries! country-ids)

    Removes country (a keyword) or countries (seqable collection of keywords) from the global registry. Automatically removes currency constrains when necessary. Returns updated registry.

    -

    If the country-ids is nil, returns current state of a global registry (but not a dynamic registry, even if it is set).

    remove-localized-properties

    added in 1.0.0

    (remove-localized-properties registry currency-id)

    Removes localized properties assigned to a currency in a registry. Returns updated registry. Expects currency ID (or equivalent) to be passed as a second argument.

    remove-localized-props!

    added in 1.0.0

    (remove-localized-props! currency)

    Removes localized properties of the given currency from the global registry.

    -

    If the currency is nil, returns current state of a global registry (but not a dynamic registry, even if it is set).

    sc

    added in 1.0.0

    (sc c)(sc c registry)(sc c locale registry)

    Returns currency scale (decimal places) as an integer number. For currencies without the assigned decimal places it will return nil (the value of auto-scaled). Locale argument is ignored.

    scale

    (scale c)(scale c registry)(scale c locale registry)

    Alias for sc.

    set-default!

    added in 1.0.0

    (set-default! c)

    Sets default currency by altering *default* dynamic variable.

    set-default-registry!

    added in 1.0.0

    (set-default-registry!)(set-default-registry! resource-path)(set-default-registry! resource-path & more)

    Sets default, global registry using a global configuration file and optional user’s configuration file. The highlighted version of a registry will be sourced from the last configuration used.

    standard?

    (standard? c)(standard? c registry)

    Alias for iso?

    symbol

    added in 1.0.0

    (symbol currency)(symbol currency locale)(symbol currency locale registry)

    Returns a currency symbol as a string for the given currency object and locale. If the locale is not given, a default one is used. Uses global registry if a registry is not given.

    +

    If the update mode is enabled then all of the current countries associated with the currency are removed and replaced with the provided ones. To simply add new countries, use add-countries. Also note that update mode removed localized properties so new one must be provided.

    register!

    added in 1.0.0

    (register! currency)(register! currency country-id-or-update?)(register! currency country-id localized-properties update?)

    Adds currency and (optional) country to the global registry. Returns updated registry. When the currency is nil, returns current state of the global, shared registry (but not a dynamic registry, even if it is set).

    remove-countries

    added in 1.0.0

    (remove-countries registry country-ids)

    Removes countries from the given registry. Also unlinks constrained currencies in proper locations. Returns updated registry.

    remove-countries!

    added in 1.0.0

    (remove-countries! country-ids)

    Removes country (a keyword) or countries (seqable collection of keywords) from the global registry. Automatically removes currency constrains when necessary. Returns updated registry.

    +

    If the country-ids is nil, returns current state of a global registry (but not a dynamic registry, even if it is set).

    remove-localized-properties

    added in 1.0.0

    (remove-localized-properties registry currency-id)

    Removes localized properties assigned to a currency in a registry. Returns updated registry. Expects currency ID (or equivalent) to be passed as a second argument.

    remove-localized-props!

    added in 1.0.0

    (remove-localized-props! currency)

    Removes localized properties of the given currency from the global registry.

    +

    If the currency is nil, returns current state of a global registry (but not a dynamic registry, even if it is set).

    sc

    added in 1.0.0

    (sc c)(sc c registry)(sc c locale registry)

    Returns currency scale (decimal places) as an integer number. For currencies without the assigned decimal places it will return nil (the value of auto-scaled). Locale argument is ignored.

    scale

    (scale c)(scale c registry)(scale c locale registry)

    Alias for sc.

    set-default!

    added in 1.0.0

    (set-default! c)

    Sets default currency by altering *default* dynamic variable.

    set-default-registry!

    added in 1.0.0

    (set-default-registry!)(set-default-registry! resource-path)(set-default-registry! resource-path & more)

    Sets default, global registry using a global configuration file and optional user’s configuration file. The highlighted version of a registry will be sourced from the last configuration used.

    standard?

    (standard? c)(standard? c registry)

    Alias for iso?

    symbol

    added in 1.0.0

    (symbol currency)(symbol currency locale)(symbol currency locale registry)

    Returns a currency symbol as a string for the given currency object and locale. If the locale is not given, a default one is used. Uses global registry if a registry is not given.

    The following tactic is applied:

    • @@ -88,6 +88,6 @@
    • If the above method failed and the given currency is ISO-standardized then Java methods will be tried to obtain it.

    -

    A locale can be expressed as java.util.Locale object or any other object (like a string or a keyword) which can be used to look up the locale.

    symbol-native

    added in 1.0.0

    (symbol-native currency)(symbol-native currency registry)

    Like symbol but for ISO-standardized currencies uses locale assigned to the first country where a currency is the default. When locale is given it is ignored.

    unregister

    added in 1.0.0

    (unregister registry currency)

    Removes a currency from the given registry. Also removes country and numeric ID constrains when necessary and all localized properties associated with a currency. Returns updated registry.

    -

    Please note that removal of a currency which identifier and numeric identifier are the same as already registered currencies, will not only remove the existing currency identified by the ID but will also remove numeric ID from within all currency objects present in a registry.

    unregister!

    added in 1.0.0

    (unregister! currency)

    Removes currency from the global registry. Automatically removes country constrains when necessary and localized properties associated with a currency. Returns updated registry.

    -

    If the currency is nil, returns current state of a global registry (but not a dynamic registry, even if it is set).

    unset-default!

    added in 1.0.0

    (unset-default!)

    Sets default currency to nil by altering *default* dynamic variable.

    update

    added in 1.1.0

    (update registry currency)(update registry currency country-ids)(update registry currency country-ids localized-properties-map)

    Replaces a currency in the given registry by a new one, preserving localized properties, relation to countries and code if not explicitly given. Returns updated registry. If the currency does not exist in a registry yet, it will be registered.

    update!

    added in 1.1.0

    (update! currency)(update! currency country-ids)(update! currency country-ids localized-properties-map)

    Replaces a currency in the global, shared registry by a new one, preserving localized properties, relation to countries and code if not explicitly given. Returns updated registry. If the currency does not exist in a registry yet, it will be registered.

    val-auto-scaled?

    added in 1.0.0

    (val-auto-scaled? scale)

    Returns true if the given scale is equal to auto-scaled.

    weight

    added in 1.0.2

    (weight c)(weight c registry)(weight c locale registry)

    Returns weight of the given currency (used to resolve conflicts when getting currencies having conflicting currency codes).

    with

    macro

    added in 1.0.0

    (with currency & body)

    Sets a default currency in a lexical context of the body.

    with-registry

    macro

    added in 1.0.0

    (with-registry registry & body)

    Sets a registry in a lexical context of the body to be used instead of a global one in functions which require the registry and it was not passed as an argument. Has the same effect as registry/with.

    \ No newline at end of file +

    A locale can be expressed as java.util.Locale object or any other object (like a string or a keyword) which can be used to look up the locale.

    symbol-native

    added in 1.0.0

    (symbol-native currency)(symbol-native currency registry)

    Like symbol but for ISO-standardized currencies uses locale assigned to the first country where a currency is the default. When locale is given it is ignored.

    unregister

    added in 1.0.0

    (unregister registry currency)

    Removes a currency from the given registry. Also removes country and numeric ID constrains when necessary and all localized properties associated with a currency. Returns updated registry.

    +

    Please note that removal of a currency which identifier and numeric identifier are the same as already registered currencies, will not only remove the existing currency identified by the ID but will also remove numeric ID from within all currency objects present in a registry.

    unregister!

    added in 1.0.0

    (unregister! currency)

    Removes currency from the global registry. Automatically removes country constrains when necessary and localized properties associated with a currency. Returns updated registry.

    +

    If the currency is nil, returns current state of a global registry (but not a dynamic registry, even if it is set).

    unset-default!

    added in 1.0.0

    (unset-default!)

    Sets default currency to nil by altering *default* dynamic variable.

    update

    added in 1.1.0

    (update registry currency)(update registry currency country-ids)(update registry currency country-ids localized-properties-map)

    Replaces a currency in the given registry by a new one, preserving localized properties, relation to countries and code if not explicitly given. Returns updated registry. If the currency does not exist in a registry yet, it will be registered.

    update!

    added in 1.1.0

    (update! currency)(update! currency country-ids)(update! currency country-ids localized-properties-map)

    Replaces a currency in the global, shared registry by a new one, preserving localized properties, relation to countries and code if not explicitly given. Returns updated registry. If the currency does not exist in a registry yet, it will be registered.

    val-auto-scaled?

    added in 1.0.0

    (val-auto-scaled? scale)

    Returns true if the given scale is equal to auto-scaled.

    weight

    added in 1.0.2

    (weight c)(weight c registry)(weight c locale registry)

    Returns weight of the given currency (used to resolve conflicts when getting currencies having conflicting currency codes).

    with

    macro

    added in 1.0.0

    (with currency & body)

    Sets a default currency in a lexical context of the body.

    with-registry

    macro

    added in 1.0.0

    (with-registry registry & body)

    Sets a registry in a lexical context of the body to be used instead of a global one in functions which require the registry and it was not passed as an argument. Has the same effect as registry/with.

    \ No newline at end of file diff --git a/docs/io.randomseed.bankster.html b/docs/io.randomseed.bankster.html index b886db1..6f6a72d 100644 --- a/docs/io.randomseed.bankster.html +++ b/docs/io.randomseed.bankster.html @@ -1,3 +1,3 @@ -io.randomseed.bankster documentation

    io.randomseed.bankster

    added in 1.0.0

    Bankster library, records and protocols.

    \ No newline at end of file +io.randomseed.bankster documentation

    io.randomseed.bankster

    added in 1.0.0

    Bankster library, records and protocols.

    \ No newline at end of file diff --git a/docs/io.randomseed.bankster.money.html b/docs/io.randomseed.bankster.money.html index a531436..10501d8 100644 --- a/docs/io.randomseed.bankster.money.html +++ b/docs/io.randomseed.bankster.money.html @@ -1,22 +1,22 @@ -io.randomseed.bankster.money documentation

    io.randomseed.bankster.money

    *

    added in 1.2.0

    (*)(* a)(* a b)(* a b & more)

    Alias for mul.

    +

    added in 1.2.0

    (+)(+ a)(+ a b)(+ a b & more)

    Alias for add.

    -

    added in 1.2.0

    (- a)(- a b)(- a b & more)

    Alias for sub.

    ->clojure-symbol

    added in 1.1.0

    (->clojure-symbol a)

    Converts an amount of the given money to a clojure symbol (with added M when needed).

    ->double

    added in 1.0.0

    (->double a)(->double a scale)(->double a rounding-mode)(->double a scale rounding-mode)

    Converts an amount of the given money to a double with optional rescaling.

    ->float

    added in 1.0.0

    (->float a)(->float a scale)(->float a rounding-mode)(->float a scale rounding-mode)

    Converts an amount of the given money to a float with optional rescaling.

    ->symbol

    added in 1.1.0

    (->symbol a)

    Converts an amount of the given money to a symbol.

    /

    added in 1.2.0

    (/ a)(/ a b)(/ a b & more)

    Alias for div.

    <

    added in 1.2.0

    (< a)(< a b)(< a b & more)

    Alias for lt?.

    <=

    added in 1.2.0

    (<= a)(<= a b)(<= a b & more)

    Alias for le?.

    =

    added in 1.2.0

    (= a)(= a b)(= a b & more)

    Alias for eq?.

    ==

    added in 1.2.0

    (== a)(== a b)(== a b & more)

    Alias for eq-am?.

    >

    added in 1.2.0

    (> a)(> a b)(> a b & more)

    Alias for gt?.

    >=

    added in 1.2.0

    (>= a)(>= a b)(>= a b & more)

    Alias for ge?.

    abs

    added in 1.2.0

    (abs a)

    Returns the absolute amount of the given money.

    Accountable

    protocol

    added in 1.0.0

    This protocol is used to express (monetary) values using various numeric types and currency representations.

    members

    cast

    added in 1.1.0

    (cast money)(cast money currency)(cast money currency rounding-mode)

    Casts an existing Money object to another having a different currency, rescaling the amount and optionally rounding it. This is useful when operating on multiple currency registries compatible with different data sources or processing engines. For simply ensuring that a currency is sourced in the right registry, use of-registry.

    value

    added in 1.0.0

    (value num)(value currency num)(value currency num rounding-mode)

    Creates new Money object for the given value which will become an amount. If the currency is not given it will try to use the default one, taken from the *default-currency* dynamic variable. Optional rounding-mode should be a rounding mode used when the conversion to a scaled monetary amount requires rounding.

    +io.randomseed.bankster.money documentation

    io.randomseed.bankster.money

    *

    added in 1.2.0

    (*)(* a)(* a b)(* a b & more)

    Alias for mul.

    +

    added in 1.2.0

    (+)(+ a)(+ a b)(+ a b & more)

    Alias for add.

    -

    added in 1.2.0

    (- a)(- a b)(- a b & more)

    Alias for sub.

    ->clojure-symbol

    added in 1.1.0

    (->clojure-symbol a)

    Converts an amount of the given money to a clojure symbol (with added M when needed).

    ->double

    added in 1.0.0

    (->double a)(->double a scale)(->double a rounding-mode)(->double a scale rounding-mode)

    Converts an amount of the given money to a double with optional rescaling.

    ->float

    added in 1.0.0

    (->float a)(->float a scale)(->float a rounding-mode)(->float a scale rounding-mode)

    Converts an amount of the given money to a float with optional rescaling.

    ->symbol

    added in 1.1.0

    (->symbol a)

    Converts an amount of the given money to a symbol.

    /

    added in 1.2.0

    (/ a)(/ a b)(/ a b & more)

    Alias for div.

    <

    added in 1.2.0

    (< a)(< a b)(< a b & more)

    Alias for lt?.

    <=

    added in 1.2.0

    (<= a)(<= a b)(<= a b & more)

    Alias for le?.

    =

    added in 1.2.0

    (= a)(= a b)(= a b & more)

    Alias for eq?.

    ==

    added in 1.2.0

    (== a)(== a b)(== a b & more)

    Alias for eq-am?.

    >

    added in 1.2.0

    (> a)(> a b)(> a b & more)

    Alias for gt?.

    >=

    added in 1.2.0

    (>= a)(>= a b)(>= a b & more)

    Alias for ge?.

    abs

    added in 1.2.0

    (abs a)

    Returns the absolute amount of the given money.

    Accountable

    protocol

    added in 1.0.0

    This protocol is used to express (monetary) values using various numeric types and currency representations.

    members

    cast

    added in 1.1.0

    (cast money)(cast money currency)(cast money currency rounding-mode)

    Casts an existing Money object to another having a different currency, rescaling the amount and optionally rounding it. This is useful when operating on multiple currency registries compatible with different data sources or processing engines. For simply ensuring that a currency is sourced in the right registry, use of-registry.

    value

    added in 1.0.0

    (value num)(value currency num)(value currency num rounding-mode)

    Creates new Money object for the given value which will become an amount. If the currency is not given it will try to use the default one, taken from the *default-currency* dynamic variable. Optional rounding-mode should be a rounding mode used when the conversion to a scaled monetary amount requires rounding.

    In its unary form, when the argument is not numeric, it will try to get the currency object (identified by a string, a symbol or a keyword) from the default, global registry of currencies.

    For simple money creation the following macros may be convenient way to go: of, of-major, of-minor.

    -

    Be careful about using number literals for big-scale amounts (16–17 digits). Use either big decimal literals, e.g. 1234.45689101112M, or strings.

    add

    added in 1.0.0

    (add)(add a)(add a b)(add a b & more)

    Adds two or more amounts of money of the same currency. When called without any arguments, returns 0.

    add-major

    added in 1.0.0

    (add-major a b)

    Increases major amount by the given number. If the number is also expressed as money and it has decimal parts, they will be truncated.

    add-minor

    added in 1.0.0

    (add-minor a b)

    Increases minor amount by the given number. If the number is also expressed as money and it has decimal parts, they will be truncated..

    add-scaled

    added in 1.0.0

    (add-scaled)(add-scaled a)(add-scaled a b)(add-scaled a b & more)

    Alias for add.

    amount

    added in 1.0.0

    (amount money)(amount a b)(amount a b r)

    Returns the amount of the given money. For more than one argument the money is created ad-hoc using a and b objects passed to the function named value.

    apply

    added in 1.2.7

    (apply money f)(apply money f a)(apply money f a b)(apply money f a b & more)

    Alias for on-amount.

    auto-scaled?

    added in 1.1.2

    (auto-scaled? m)

    Returns true if the given Money object is based on a currency which is auto-scaled.

    code-literal

    added in 1.2.4

    (code-literal arg)

    Tagged literal handler for Money objects expressed as tagged literals in Clojure code. Returns compound forms (parsing function invocations that can be influenced by the runtime environment, e.g. dynamic variables like scale/*rounding-mode*).

    code-readers

    added in 1.2.4

    Data readers map for currency and money (intended to be used when evaluating Clojure code with tagged literals: #currency and #money). Handlers assigned to literals may emit compound forms, like function call forms (as Clojure code). To operate on EDN data files, see data-readers.

    compare

    added in 1.0.0

    (compare a)(compare a b)

    Compares two monetary amounts of the same currency and scale. Returns -1 if the second one is less than, 0 if equal to, and 1 if it is greater than the first. Nil values are always considered lower when comparing.

    compare-amounts

    added in 1.0.0

    (compare-amounts a)(compare-amounts a b)

    Compares two monetary amounts of the same currency, regardless of their scales. Returns -1 if the second one is less than, 0 if equal to, and 1 if it is greater than the first. Nil values are always considered lower when comparing.

    convert

    added in 1.0.0

    (convert money price)(convert money price rounding-mode)(convert money to-currency exchange-rate)(convert money to-currency exchange-rate rounding-mode)

    Converts a monetary amount from one currency to another using the given multiplier (expressing a conversion rate). When two money objects are given, the second one should express a price of 1 unit of the first currency.

    -

    When no rounding mode is given and rounding is required during scaling to another currency then the value of dynamic variable io.randomseed.bankster.scale/*rounding-mode* will be used.

    currency

    added in 1.0.0

    (currency money)(currency a b)(currency a b r)

    Returns the currency of the given money. For more than one argument the money is created ad-hoc using a and b objects passed to the function named value.

    data-literal

    added in 1.2.4

    (data-literal arg)

    Data reader for Money objects expressed as tagged literals in EDN data files.

    data-readers

    added in 1.2.4

    Data readers map for currency and money (intended to be used when reading EDN data files containing tagged literals: #currency and #money). Handlers assigned to literals are always emitting constant forms. Please note that tagged literal handlers for Clojure code are using different readers (defined as code-readers).

    dec-major

    added in 1.0.0

    (dec-major a)

    Decreases major amount by 1.

    dec-minor

    added in 1.0.0

    (dec-minor a)

    Decreases minor amount by 1.

    defliteral

    added in 1.0.0

    (defliteral c)

    For the given currency identifier or a currency object it creates a tagged literal in a form of #money/CURRENCY where the CURRENCY is a currency code. As a side effect it creates a function of name io.randomseed.bankster.money/of-CURRENCY that will handle the literal.

    -

    The literals will be bound to data-readers in a local thread.

    div

    added in 1.0.0

    (div a)(div a b)(div a b & more)

    Divides two or more amounts of money of the same currency or numbers. If two of the given values are a kind of Money, the result will be a BigDecimal number. If the earlier value is a kind of Money and the second is a number, the result will be a Money. If the first argument is a number and the second argument is a monetary amount, an exception will be thrown. The result will always be either a kind of Money or a BigDecimal number.

    +

    Be careful about using number literals for big-scale amounts (16–17 digits). Use either big decimal literals, e.g. 1234.45689101112M, or strings.

    add

    added in 1.0.0

    (add)(add a)(add a b)(add a b & more)

    Adds two or more amounts of money of the same currency. When called without any arguments, returns 0.

    add-major

    added in 1.0.0

    (add-major a b)

    Increases major amount by the given number. If the number is also expressed as money and it has decimal parts, they will be truncated.

    add-minor

    added in 1.0.0

    (add-minor a b)

    Increases minor amount by the given number. If the number is also expressed as money and it has decimal parts, they will be truncated..

    add-scaled

    added in 1.0.0

    (add-scaled)(add-scaled a)(add-scaled a b)(add-scaled a b & more)

    Alias for add.

    amount

    added in 1.0.0

    (amount money)(amount a b)(amount a b r)

    Returns the amount of the given money. For more than one argument the money is created ad-hoc using a and b objects passed to the function named value.

    apply

    added in 1.2.7

    (apply money f)(apply money f a)(apply money f a b)(apply money f a b & more)

    Alias for on-amount.

    auto-scaled?

    added in 1.1.2

    (auto-scaled? m)

    Returns true if the given Money object is based on a currency which is auto-scaled.

    code-literal

    added in 1.2.4

    (code-literal arg)

    Tagged literal handler for Money objects expressed as tagged literals in Clojure code. Returns compound forms (parsing function invocations that can be influenced by the runtime environment, e.g. dynamic variables like scale/*rounding-mode*).

    code-readers

    added in 1.2.4

    Data readers map for currency and money (intended to be used when evaluating Clojure code with tagged literals: #currency and #money). Handlers assigned to literals may emit compound forms, like function call forms (as Clojure code). To operate on EDN data files, see data-readers.

    compare

    added in 1.0.0

    (compare a)(compare a b)

    Compares two monetary amounts of the same currency and scale. Returns -1 if the second one is less than, 0 if equal to, and 1 if it is greater than the first. Nil values are always considered lower when comparing.

    compare-amounts

    added in 1.0.0

    (compare-amounts a)(compare-amounts a b)

    Compares two monetary amounts of the same currency, regardless of their scales. Returns -1 if the second one is less than, 0 if equal to, and 1 if it is greater than the first. Nil values are always considered lower when comparing.

    convert

    added in 1.0.0

    (convert money price)(convert money price rounding-mode)(convert money to-currency exchange-rate)(convert money to-currency exchange-rate rounding-mode)

    Converts a monetary amount from one currency to another using the given multiplier (expressing a conversion rate). When two money objects are given, the second one should express a price of 1 unit of the first currency.

    +

    When no rounding mode is given and rounding is required during scaling to another currency then the value of dynamic variable io.randomseed.bankster.scale/*rounding-mode* will be used.

    currency

    added in 1.0.0

    (currency money)(currency a b)(currency a b r)

    Returns the currency of the given money. For more than one argument the money is created ad-hoc using a and b objects passed to the function named value.

    data-literal

    added in 1.2.4

    (data-literal arg)

    Data reader for Money objects expressed as tagged literals in EDN data files.

    data-readers

    added in 1.2.4

    Data readers map for currency and money (intended to be used when reading EDN data files containing tagged literals: #currency and #money). Handlers assigned to literals are always emitting constant forms. Please note that tagged literal handlers for Clojure code are using different readers (defined as code-readers).

    dec-major

    added in 1.0.0

    (dec-major a)

    Decreases major amount by 1.

    dec-minor

    added in 1.0.0

    (dec-minor a)

    Decreases minor amount by 1.

    defliteral

    added in 1.0.0

    (defliteral c)

    For the given currency identifier or a currency object it creates a tagged literal in a form of #money/CURRENCY where the CURRENCY is a currency code. As a side effect it creates a function of name io.randomseed.bankster.money/of-CURRENCY that will handle the literal.

    +

    The literals will be bound to data-readers in a local thread.

    div

    added in 1.0.0

    (div a)(div a b)(div a b & more)

    Divides two or more amounts of money of the same currency or numbers. If two of the given values are a kind of Money, the result will be a BigDecimal number. If the earlier value is a kind of Money and the second is a number, the result will be a Money. If the first argument is a number and the second argument is a monetary amount, an exception will be thrown. The result will always be either a kind of Money or a BigDecimal number.

    For a single value it returns a division of 1 by the given number or monetary value.

    For more than 2 arguments it repeatedly divides their values as described. If the previous calculations produce a regular number, all consequent divisors must be regular numbers. Practically, if the division begins with a monetary amount, only one monetary amount at some point later is permitted (which will cause the function to switch to the regular numbers calculation since the units will cancel themselves).

    Note that rescaling is not based on the original scale of a currency. This is designed that way is to handle cases when monetary amount was intentionally rescaled earlier.

    For regular numbers and for monetary values of auto-scaled currencies the dynamic rescaling is performed to handle corner cases where there would be a non-terminating decimal expansion. Trailing zeros are stripped before any calculation.

    -

    Rescaling is performed after all calculations are done. However, the scale can be applied on each calculation if the dynamic variable io.randomseed.bankster.scale/*each* is set to a truthy value. If the scaling requires rounding then enclosing the expression within with-rounding is required. This can also be achieved by enclosing the expression within io.randomseed.bankster.scale/with-rescaling (aliased in this namespace under the same name) macro combining the switch and setting the scale.

    div-rem

    added in 1.1.0

    (div-rem a b)

    Alias for rem.

    div-scaled

    added in 1.0.0

    (div-scaled a)(div-scaled a b)(div-scaled a b & more)

    Divides two or more amounts of money of the same currency or numbers. Scales and optionally rounds each intermediate result (if there are more divisors).

    +

    Rescaling is performed after all calculations are done. However, the scale can be applied on each calculation if the dynamic variable io.randomseed.bankster.scale/*each* is set to a truthy value. If the scaling requires rounding then enclosing the expression within with-rounding is required. This can also be achieved by enclosing the expression within io.randomseed.bankster.scale/with-rescaling (aliased in this namespace under the same name) macro combining the switch and setting the scale.

    div-rem

    added in 1.1.0

    (div-rem a b)

    Alias for rem.

    div-scaled

    added in 1.0.0

    (div-scaled a)(div-scaled a b)(div-scaled a b & more)

    Divides two or more amounts of money of the same currency or numbers. Scales and optionally rounds each intermediate result (if there are more divisors).

    If the first given argument is a kind of money and one of the divisors is also a kind of Money, the result will be a BigDecimal kind of number. If the earlier value is a kind of Money and the second is a number, the result will be a Money. If the first argument is a number and the second argument is a monetary amount, an exception will be thrown.

    For a single value it returns a division of 1 by the given number or monetary value.

    For more than 2 arguments it repeatedly divides their values as described and re-scales each result to match the scale of the first encountered monetary amount. If there are no monetary amounts involved the scale is calculated dynamically.

    Note that rescaling is not based on the original scale of a currency. This is designed that way is to handle cases when monetary amount was intentionally rescaled earlier.

    For regular numbers and for monetary values of auto-scaled currencies the dynamic rescaling is performed to handle corner cases where there would be a non-terminating decimal expansion. Trailing zeros are stripped before any calculation.

    -

    If the scaling requires rounding then enclosing the expression within with-rounding (also present in io.randomseed.bankster.scale namespace) is required.

    eq-am?

    added in 1.0.0

    (eq-am? a)(eq-am? a b)(eq-am? a b & more)

    Return true if the monetary amounts and their currencies are equal, regardless of their scales.

    eq?

    added in 1.0.0

    (eq? a)(eq? a b)(eq? a b & more)

    Return true if the money amounts and their currencies are equal. Note that currencies with different scales or other properties are considered different. Use eq-am? (aliased as ==) to compare amounts regardless of their scales.

    format

    added in 1.0.0

    (format money)(format money locale)(format money locale opts)

    Formats the given amount of money as a string according to localization rules. If the locale argument is not given then the default is used.

    +

    If the scaling requires rounding then enclosing the expression within with-rounding (also present in io.randomseed.bankster.scale namespace) is required.

    eq-am?

    added in 1.0.0

    (eq-am? a)(eq-am? a b)(eq-am? a b & more)

    Return true if the monetary amounts and their currencies are equal, regardless of their scales.

    eq?

    added in 1.0.0

    (eq? a)(eq? a b)(eq? a b & more)

    Return true if the money amounts and their currencies are equal. Note that currencies with different scales or other properties are considered different. Use eq-am? (aliased as ==) to compare amounts regardless of their scales.

    format

    added in 1.0.0

    (format money)(format money locale)(format money locale opts)

    Formats the given amount of money as a string according to localization rules. If the locale argument is not given then the default is used.

    It is advised to express locale using a keyword when huge amount of operations is expected.

    If there are 3 arguments passed the third one should be a map of options customizing the formatting. It can have the following keys:

      @@ -36,17 +36,17 @@
    • :scale - sets both :min-fraction-digits and :max-fraction-digits to the same value.

    The function assigned to the :currency-symbol-fn should take 3 arguments: currency, locale and registry.

    -

    Note that you may gain some speed by re-using the extended formatter (basic formatter is already cached). See the documentation of the format-with function for more information.

    format-with

    added in 1.0.0

    (format-with formatter money)

    Formats the amount of money using the formatter provided. Formatters can be created with io.randomseed.bankster.currency/formatter and io.randomseed.bankster.currency/formatter-extended.

    ge?

    added in 1.0.0

    (ge? a)(ge? a b)(ge? a b & more)

    Returns non-nil if monetary amounts are in monotonically non-increasing order, otherwise false.

    gt?

    added in 1.0.0

    (gt? a)(gt? a b)(gt? a b & more)

    Returns non-nil if monetary amounts are in monotonically decreasing order, otherwise false.

    inc-major

    added in 1.0.0

    (inc-major a)

    Increases major amount by 1.

    inc-minor

    added in 1.0.0

    (inc-minor a)

    Increases minor amount by 1.

    is-neg-or-zero?

    added in 1.0.0

    (is-neg-or-zero? a)

    Returns true if the given monetary amount is a negative number or zero.

    is-neg?

    added in 1.0.0

    (is-neg? a)

    Returns true if the given monetary amount is a negative number.

    is-pos-or-zero?

    added in 1.0.0

    (is-pos-or-zero? a)

    Returns true if the given monetary amount is a positive number or zero.

    is-pos?

    added in 1.0.0

    (is-pos? a)

    Returns true if the given monetary amount is a positive number.

    is-zero?

    added in 1.0.0

    (is-zero? a)

    Returns true if the given monetary amount is a positive number.

    le?

    added in 1.0.0

    (le? a)(le? a b)(le? a b & more)

    Returns non-nil if monetary amounts are in monotonically non-decreasing order, otherwise false.

    lt?

    added in 1.0.0

    (lt? a)(lt? a b)(lt? a b & more)

    Returns non-nil if monetary amounts are in monotonically increasing order, otherwise false.

    major

    added in 1.0.0

    (major a)

    Returns the major part of the given amount of money.

    major->int

    added in 1.0.0

    (major->int a)

    Returns the major part of the given amount as a int number.

    major->long

    added in 1.0.0

    (major->long a)

    Returns the major part of the given amount as a long number.

    major-minor

    added in 1.0.0

    (major-minor a)

    Returns a vector with major and minor parts of the given monetary amount.

    major-minor->int

    added in 1.0.0

    (major-minor->int a)

    Returns a vector with major and minor parts of the given monetary amount represented as integer numbers.

    major-minor->long

    added in 1.0.0

    (major-minor->long a)

    Returns a vector with major and minor parts of the given monetary amount represented as long numbers.

    major-value

    (major-value a)(major-value currency amount)(major-value currency amount rounding-mode)

    Creates new Money object for the given value which will become a major part of the amount. If the given number has fractional part it will be truncated. If the currency is not given it should try to use the default one, taken from the io.randomseed.bankster.currency/*default* dynamic variable. Optional rounding-mode should be a rounding mode used when the conversion to a scaled monetary amount requires rounding.

    -

    For simple money creation the following macros may be convenient way to go: of, of-major, of-minor.

    max

    added in 1.2.0

    (max a)(max a b)(max a b & more)

    Alias for max-amount.

    max-amount

    added in 1.0.0

    (max-amount a)(max-amount a b)(max-amount a b & more)

    Returns the greatest of the monetary amounts.

    min

    added in 1.2.0

    (min a)(min a b)(min a b & more)

    Alias for min-amount.

    min-amount

    added in 1.0.0

    (min-amount a)(min-amount a b)(min-amount a b & more)

    Returns the least of the monetary amounts.

    minor

    added in 1.0.0

    (minor a)

    Returns the minor part of the given amount.

    minor->int

    added in 1.0.0

    (minor->int a)

    Returns the minor part of the given amount as an integer number.

    minor->long

    added in 1.0.0

    (minor->long a)

    Returns the minor part of the given amount as a long number.

    minor-value

    (minor-value a)(minor-value currency amount)(minor-value currency amount rounding-mode)

    Creates new Money object for the given value which will become a minor part of the amount. If the given number has fractional part it will be truncated. If the currency is not given it should try to use the default one, taken from the io.randomseed.bankster.currency/*default* dynamic variable. Optional rounding-mode should be a rounding mode used when the conversion to a scaled monetary amount requires rounding.

    -

    For simple money creation the following macros may be convenient way to go: of, of-major, of-minor.

    money?

    added in 1.0.0

    (money? a)

    Returns true if the given value is a kind of Money.

    mul

    added in 1.0.0

    (mul)(mul a)(mul a b)(mul a b & more)

    Multiplies two or more values where one may be a Money object. If one of the values is a kind of Money then the result will also be a kind of Money. For a single value it simply returns it. For more than 2 arguments it repeatedly multiplies them as described.

    +

    Note that you may gain some speed by re-using the extended formatter (basic formatter is already cached). See the documentation of the format-with function for more information.

    format-with

    added in 1.0.0

    (format-with formatter money)

    Formats the amount of money using the formatter provided. Formatters can be created with io.randomseed.bankster.currency/formatter and io.randomseed.bankster.currency/formatter-extended.

    ge?

    added in 1.0.0

    (ge? a)(ge? a b)(ge? a b & more)

    Returns non-nil if monetary amounts are in monotonically non-increasing order, otherwise false.

    gt?

    added in 1.0.0

    (gt? a)(gt? a b)(gt? a b & more)

    Returns non-nil if monetary amounts are in monotonically decreasing order, otherwise false.

    inc-major

    added in 1.0.0

    (inc-major a)

    Increases major amount by 1.

    inc-minor

    added in 1.0.0

    (inc-minor a)

    Increases minor amount by 1.

    is-neg-or-zero?

    added in 1.0.0

    (is-neg-or-zero? a)

    Returns true if the given monetary amount is a negative number or zero.

    is-neg?

    added in 1.0.0

    (is-neg? a)

    Returns true if the given monetary amount is a negative number.

    is-pos-or-zero?

    added in 1.0.0

    (is-pos-or-zero? a)

    Returns true if the given monetary amount is a positive number or zero.

    is-pos?

    added in 1.0.0

    (is-pos? a)

    Returns true if the given monetary amount is a positive number.

    is-zero?

    added in 1.0.0

    (is-zero? a)

    Returns true if the given monetary amount is a positive number.

    le?

    added in 1.0.0

    (le? a)(le? a b)(le? a b & more)

    Returns non-nil if monetary amounts are in monotonically non-decreasing order, otherwise false.

    lt?

    added in 1.0.0

    (lt? a)(lt? a b)(lt? a b & more)

    Returns non-nil if monetary amounts are in monotonically increasing order, otherwise false.

    major

    added in 1.0.0

    (major a)

    Returns the major part of the given amount of money.

    major->int

    added in 1.0.0

    (major->int a)

    Returns the major part of the given amount as a int number.

    major->long

    added in 1.0.0

    (major->long a)

    Returns the major part of the given amount as a long number.

    major-minor

    added in 1.0.0

    (major-minor a)

    Returns a vector with major and minor parts of the given monetary amount.

    major-minor->int

    added in 1.0.0

    (major-minor->int a)

    Returns a vector with major and minor parts of the given monetary amount represented as integer numbers.

    major-minor->long

    added in 1.0.0

    (major-minor->long a)

    Returns a vector with major and minor parts of the given monetary amount represented as long numbers.

    major-value

    (major-value a)(major-value currency amount)(major-value currency amount rounding-mode)

    Creates new Money object for the given value which will become a major part of the amount. If the given number has fractional part it will be truncated. If the currency is not given it should try to use the default one, taken from the io.randomseed.bankster.currency/*default* dynamic variable. Optional rounding-mode should be a rounding mode used when the conversion to a scaled monetary amount requires rounding.

    +

    For simple money creation the following macros may be convenient way to go: of, of-major, of-minor.

    max

    added in 1.2.0

    (max a)(max a b)(max a b & more)

    Alias for max-amount.

    max-amount

    added in 1.0.0

    (max-amount a)(max-amount a b)(max-amount a b & more)

    Returns the greatest of the monetary amounts.

    min

    added in 1.2.0

    (min a)(min a b)(min a b & more)

    Alias for min-amount.

    min-amount

    added in 1.0.0

    (min-amount a)(min-amount a b)(min-amount a b & more)

    Returns the least of the monetary amounts.

    minor

    added in 1.0.0

    (minor a)

    Returns the minor part of the given amount.

    minor->int

    added in 1.0.0

    (minor->int a)

    Returns the minor part of the given amount as an integer number.

    minor->long

    added in 1.0.0

    (minor->long a)

    Returns the minor part of the given amount as a long number.

    minor-value

    (minor-value a)(minor-value currency amount)(minor-value currency amount rounding-mode)

    Creates new Money object for the given value which will become a minor part of the amount. If the given number has fractional part it will be truncated. If the currency is not given it should try to use the default one, taken from the io.randomseed.bankster.currency/*default* dynamic variable. Optional rounding-mode should be a rounding mode used when the conversion to a scaled monetary amount requires rounding.

    +

    For simple money creation the following macros may be convenient way to go: of, of-major, of-minor.

    money?

    added in 1.0.0

    (money? a)

    Returns true if the given value is a kind of Money.

    mul

    added in 1.0.0

    (mul)(mul a)(mul a b)(mul a b & more)

    Multiplies two or more values where one may be a Money object. If one of the values is a kind of Money then the result will also be a kind of Money. For a single value it simply returns it. For more than 2 arguments it repeatedly multiplies them as described.

    When there is a multiplication of a monetary value by the regular number, the final result of all operations is re-scaled to match the scale of monetary amount. If the scaling requires rounding, enclosing the expression within io.randomseed.bankster.scale/with-rounding is required (the macro is aliased under the same name in this namespace).

    Note that rescaling is not based on the original scale of a currency. This is designed that way is to handle cases when monetary amount was intentionally rescaled earlier.

    For regular numbers dynamic rescaling is performed only to handle corner cases where there would be a non-terminating decimal expansion.

    -

    Rescaling is performed after performing all operations unless all values are regular numbers (without any Money object among them).

    mul-scaled

    added in 1.0.0

    (mul-scaled)(mul-scaled a)(mul-scaled a b)(mul-scaled a b & more)

    Multiplies two or more values where one may be a Money object. If one of the values is a kind of Money then the result will also be a kind of Money. For a single value it simply returns it. For more than 2 arguments it repeatedly multiplies them as described.

    +

    Rescaling is performed after performing all operations unless all values are regular numbers (without any Money object among them).

    mul-scaled

    added in 1.0.0

    (mul-scaled)(mul-scaled a)(mul-scaled a b)(mul-scaled a b & more)

    Multiplies two or more values where one may be a Money object. If one of the values is a kind of Money then the result will also be a kind of Money. For a single value it simply returns it. For more than 2 arguments it repeatedly multiplies them as described.

    When there is a multiplication of a monetary value by the regular number, the final result of all operations is re-scaled to match the scale of the monetary amount. If the scaling requires rounding, enclosing the expression within io.randomseed.bankster.scale/with-rounding is required (the macro is aliased under the same name in this namespace).

    Note that rescaling is not based on the original scale of a currency. This is designed that way is to handle cases when monetary amount was intentionally rescaled earlier.

    For regular numbers dynamic rescaling is performed only to handle corner cases where there would be a non-terminating decimal expansion.

    -

    Rescaling is performed on each operation unless/until all values are regular numbers (without any Money object among them).

    ne-am?

    added in 1.0.0

    (ne-am? a)(ne-am? a b)(ne-am? a b & more)

    Returns true if the money amounts or their currencies are different, regardless of their scales.

    ne?

    added in 1.0.0

    (ne? a)(ne? a b)(ne? a b & more)

    Returns true if the money amounts or their currencies are different, regardless of their scales. Note that currencies with different scales are considered different.

    neg

    added in 1.0.0

    (neg a)

    Returns the negated amount of the given money. For negative amount it will reverse their sign. Same as (sub x).

    neg-or-zero?

    added in 1.2.0

    (neg-or-zero? a)

    Alias for is-neg-or-zero?.

    neg?

    added in 1.2.0

    (neg? a)

    Alias for is-neg?.

    not=

    added in 1.2.0

    (not= a)(not= a b)(not= a b & more)

    Alias for ne?.

    not==

    added in 1.2.0

    (not== a)(not== a b)(not== a b & more)

    Alias for ne-am?.

    of

    macro

    (of)(of a)(of a b)(of a b rounding-mode)

    Returns the amount of money as a Money object consisting of a currency and a value. Currency can be a currency object and for registered currencies: a keyword, a symbol or a string (e.g. EUR, :EUR, “PLN” or crypto/ETH), or even a number (for ISO-compliant currencies).

    +

    Rescaling is performed on each operation unless/until all values are regular numbers (without any Money object among them).

    ne-am?

    added in 1.0.0

    (ne-am? a)(ne-am? a b)(ne-am? a b & more)

    Returns true if the money amounts or their currencies are different, regardless of their scales.

    ne?

    added in 1.0.0

    (ne? a)(ne? a b)(ne? a b & more)

    Returns true if the money amounts or their currencies are different, regardless of their scales. Note that currencies with different scales are considered different.

    neg

    added in 1.0.0

    (neg a)

    Returns the negated amount of the given money. For negative amount it will reverse their sign. Same as (sub x).

    neg-or-zero?

    added in 1.2.0

    (neg-or-zero? a)

    Alias for is-neg-or-zero?.

    neg?

    added in 1.2.0

    (neg? a)

    Alias for is-neg?.

    not=

    added in 1.2.0

    (not= a)(not= a b)(not= a b & more)

    Alias for ne?.

    not==

    added in 1.2.0

    (not== a)(not== a b)(not== a b & more)

    Alias for ne-am?.

    of

    macro

    (of)(of a)(of a b)(of a b rounding-mode)

    Returns the amount of money as a Money object consisting of a currency and a value. Currency can be a currency object and for registered currencies: a keyword, a symbol or a string (e.g. EUR, :EUR, “PLN” or crypto/ETH), or even a number (for ISO-compliant currencies).

    The given amount can be any numeric value or a string that can be converted to java.math.BigDecimal.

    When a number must be downscaled to fulfill the number of decimal places for a currency, rounding mode must be given, which may be a symbol, a keyword or a string of the following:

      @@ -60,8 +60,8 @@
    • UNNECESSARY - asserts that the requested operation has an exact result, hence no rounding is necessary.

    To create a monetary object using function, call io.randomseed.bankster.money/value.

    -

    Be careful about using number literals for big-scale amounts (16–17 digits). Use either big decimal literals, e.g. 1234.45689101112M, or strings.

    of-major

    macro

    (of-major)(of-major a)(of-major a b)(of-major a b rounding-mode)

    Like io.randomseed.money/of but sets the amount of major part only.

    of-minor

    macro

    (of-minor)(of-minor a)(of-minor a b)(of-minor a b rounding-mode)

    Like io.randomseed.money/of but sets the amount of minor part only.

    of-registry

    added in 1.1.2

    (of-registry money)(of-registry registry money)(of-registry registry money rounding-mode)

    Ensures that a currency of the given money originates from the given registry. If the registry is not given and a dynamic registry is not set, the default one is used. Rescales the amount if needed to match the nominal scale. Optional rounding-mode can be supplied to be used when downscaling is needed (nominal currency from a registry has lower number of decimal places than the amount of money).

    -

    Money can be expressed as a Money object or any other object that will create Money when passed to the value function. Returns money.

    on-amount

    added in 1.1.2

    (on-amount money f)(on-amount money f a)(on-amount money f a b)(on-amount money f a b & more)

    Performs an operation expressed with a function f on an amount of the given money. Additional arguments will be passed to the f. Returns the money with the amount updated. The function f must return a number. Short-circuits on nil as an argument. Rescales the result to the existing scale of an amount, not the nominal scale of a currency.

    pos

    added in 1.0.0

    (pos a)

    Returns the given money object.

    pos-or-zero?

    added in 1.2.0

    (pos-or-zero? a)

    Alias for is-pos-or-zero?.

    pos?

    added in 1.2.0

    (pos? a)

    Alias for is-pos?.

    rem

    added in 1.2.0

    (rem a b)(rem a b rounding-mode)

    Returns the remainder of dividing an mount of money by the given number. For two money objects the result is BigDecimal. When only the first one is a kind of Money the result will also be a Money. In the last case the result will be rescaled to the scale of the monetary amount. When rounding mode is not give io.randomseed.bankster.scale/*rounding-mode* will be used when set.

    rescale

    added in 1.0.0

    (rescale money)(rescale money scale)(rescale money scale rounding-mode)

    Same as scale but its unary variant will rescale an amount of the given money to conform it to its currency settings instead of returning the scale. It has the same effect as calling io.randomseed.bankster.scale/apply on a Money object.

    rescaled?

    added in 1.0.0

    (rescaled? a)

    Returns true if the given monetary value has different scale than its currency (so it was rescaled). Returns false if the scale is no different. Returns nil if the currency does not have a fixed scale.

    round

    added in 1.0.0

    (round money scale)(round money scale rounding-mode)

    Rounds the amount of money using the given scale and rounding mode. Returns money with rounded amount preserving the original scale. If the rounding mode is not given the one from scale/*rounding-mode* is used.

    round-to

    added in 1.2.9

    (round-to money)(round-to money i)(round-to money i rounding-mode)

    Rounds a Money to an interval i (which should also be Money or a number). If rounding mode is not provided (via the last argument or scale/*rounding-mode*) then it defaults to HALF_EVEN. Retains original scale of the amount (but not the nominal scale of a currency, if money was given). For nil intervals or intervals which amounts are negative or zero, returns unaltered monetary object.

    same-currencies?

    added in 1.0.0

    (same-currencies? a b)

    Returns true if both currencies are the same for the given money objects.

    same-currency-ids?

    added in 1.0.0

    (same-currency-ids? a b)

    Returns true if both currencies have the same IDs for the given money objects.

    scale

    added in 1.0.0

    (scale money)(scale money scale)(scale money scale rounding-mode)

    Re-scales the given money using a scale (number of decimal places) and an optional rounding mode (required when downscaling). The internal scale for a currency object is NOT updated. If no scale is given, returns the current scale of an amount (not the nominal scale of a currency – which is important in rescaled amount or auto-scaled currencies).

    +

    Be careful about using number literals for big-scale amounts (16–17 digits). Use either big decimal literals, e.g. 1234.45689101112M, or strings.

    of-major

    macro

    (of-major)(of-major a)(of-major a b)(of-major a b rounding-mode)

    Like io.randomseed.money/of but sets the amount of major part only.

    of-minor

    macro

    (of-minor)(of-minor a)(of-minor a b)(of-minor a b rounding-mode)

    Like io.randomseed.money/of but sets the amount of minor part only.

    of-registry

    added in 1.1.2

    (of-registry money)(of-registry registry money)(of-registry registry money rounding-mode)

    Ensures that a currency of the given money originates from the given registry. If the registry is not given and a dynamic registry is not set, the default one is used. Rescales the amount if needed to match the nominal scale. Optional rounding-mode can be supplied to be used when downscaling is needed (nominal currency from a registry has lower number of decimal places than the amount of money).

    +

    Money can be expressed as a Money object or any other object that will create Money when passed to the value function. Returns money.

    on-amount

    added in 1.1.2

    (on-amount money f)(on-amount money f a)(on-amount money f a b)(on-amount money f a b & more)

    Performs an operation expressed with a function f on an amount of the given money. Additional arguments will be passed to the f. Returns the money with the amount updated. The function f must return a number. Short-circuits on nil as an argument. Rescales the result to the existing scale of an amount, not the nominal scale of a currency.

    pos

    added in 1.0.0

    (pos a)

    Returns the given money object.

    pos-or-zero?

    added in 1.2.0

    (pos-or-zero? a)

    Alias for is-pos-or-zero?.

    pos?

    added in 1.2.0

    (pos? a)

    Alias for is-pos?.

    rem

    added in 1.2.0

    (rem a b)(rem a b rounding-mode)

    Returns the remainder of dividing an mount of money by the given number. For two money objects the result is BigDecimal. When only the first one is a kind of Money the result will also be a Money. In the last case the result will be rescaled to the scale of the monetary amount. When rounding mode is not give io.randomseed.bankster.scale/*rounding-mode* will be used when set.

    rescale

    added in 1.0.0

    (rescale money)(rescale money scale)(rescale money scale rounding-mode)

    Same as scale but its unary variant will rescale an amount of the given money to conform it to its currency settings instead of returning the scale. It has the same effect as calling io.randomseed.bankster.scale/apply on a Money object.

    rescaled?

    added in 1.0.0

    (rescaled? a)

    Returns true if the given monetary value has different scale than its currency (so it was rescaled). Returns false if the scale is no different. Returns nil if the currency does not have a fixed scale.

    round

    added in 1.0.0

    (round money scale)(round money scale rounding-mode)

    Rounds the amount of money using the given scale and rounding mode. Returns money with rounded amount preserving the original scale. If the rounding mode is not given the one from scale/*rounding-mode* is used.

    round-to

    added in 1.2.9

    (round-to money)(round-to money i)(round-to money i rounding-mode)

    Rounds a Money to an interval i (which should also be Money or a number). If rounding mode is not provided (via the last argument or scale/*rounding-mode*) then it defaults to HALF_EVEN. Retains original scale of the amount (but not the nominal scale of a currency, if money was given). For nil intervals or intervals which amounts are negative or zero, returns unaltered monetary object.

    same-currencies?

    added in 1.0.0

    (same-currencies? a b)

    Returns true if both currencies are the same for the given money objects.

    same-currency-ids?

    added in 1.0.0

    (same-currency-ids? a b)

    Returns true if both currencies have the same IDs for the given money objects.

    scale

    added in 1.0.0

    (scale money)(scale money scale)(scale money scale rounding-mode)

    Re-scales the given money using a scale (number of decimal places) and an optional rounding mode (required when downscaling). The internal scale for a currency object is NOT updated. If no scale is given, returns the current scale of an amount (not the nominal scale of a currency – which is important in rescaled amount or auto-scaled currencies).

    Auto-scaled monetary values are returned unchanged.

    -

    Use with caution since it can make money object no longer compliant with a scale of the currency.

    set-amount

    added in 1.2.7

    (set-amount money v)(set-amount money v rounding-mode)

    Sets the amount of the given monetary object. Rescales value to a scale of the given monetary object, not the nominal scale of its currency.

    strip

    added in 1.0.0

    (strip a)

    Strips trailing zeros from the amount of money. The internal scale for a currency object is NOT updated.

    -

    Use with caution since it can make money object no longer compliant with a scale of the registered currency.

    stripped-amount

    added in 1.0.0

    (stripped-amount money)(stripped-amount a b)(stripped-amount a b r)

    Returns the amount of the given money with trailing zeros removed. For more than one argument the money is created ad-hoc using a and b objects passed to the function named value.

    sub

    added in 1.0.0

    (sub a)(sub a b)(sub a b & more)

    Subtracts two or more amounts of money of the same currency. When called with a single argument, negates its value.

    sub-major

    added in 1.0.0

    (sub-major a b)

    Decreases major amount by the given number. If the number is also expressed as money and it has decimal parts, they will be truncated.

    sub-minor

    added in 1.0.0

    (sub-minor a b)

    Decreases minor amount by the given number. If the number is also expressed as money and it has decimal parts, they will be truncated. If the major component comes from a money object, its currency must match the given money. This check is performed to prevent mistakes; if you need to subtract minor parts of money with different currencies, use (minor x) on the second argument.

    sub-scaled

    added in 1.0.0

    (sub-scaled a)(sub-scaled a b)(sub-scaled a b & more)

    Alias for sub.

    unparse

    added in 1.0.7

    (unparse money)(unparse a b)(unparse a b r)

    Returns a vector with symbolic representations of amount and currency. Useful for printing to EDN or displaying on a console. The letter M will be added to the amount if its precision exceeds 15. For more than one argument the money is created ad-hoc using a and b objects passed to the function named value.

    with-currency

    macro

    added in 1.0.0

    (with-currency currency & body)

    Sets a default currency in a lexical context of the body. Has the same effect as io.randomseed.bankster.currency/with.

    with-rescaling

    macro

    added in 1.0.0

    (with-rescaling rounding-mode & body)

    Alias for io.randomseed.bankster.scale/with-rescaling.

    with-rounding

    macro

    added in 1.0.0

    (with-rounding rounding-mode & body)

    Alias for io.randomseed.bankster.scale/with-rounding.

    zero?

    added in 1.2.0

    (zero? a)

    Alias for is-zero?.

    \ No newline at end of file +

    Use with caution since it can make money object no longer compliant with a scale of the currency.

    set-amount

    added in 1.2.7

    (set-amount money v)(set-amount money v rounding-mode)

    Sets the amount of the given monetary object. Rescales value to a scale of the given monetary object, not the nominal scale of its currency.

    strip

    added in 1.0.0

    (strip a)

    Strips trailing zeros from the amount of money. The internal scale for a currency object is NOT updated.

    +

    Use with caution since it can make money object no longer compliant with a scale of the registered currency.

    stripped-amount

    added in 1.0.0

    (stripped-amount money)(stripped-amount a b)(stripped-amount a b r)

    Returns the amount of the given money with trailing zeros removed. For more than one argument the money is created ad-hoc using a and b objects passed to the function named value.

    sub

    added in 1.0.0

    (sub a)(sub a b)(sub a b & more)

    Subtracts two or more amounts of money of the same currency. When called with a single argument, negates its value.

    sub-major

    added in 1.0.0

    (sub-major a b)

    Decreases major amount by the given number. If the number is also expressed as money and it has decimal parts, they will be truncated.

    sub-minor

    added in 1.0.0

    (sub-minor a b)

    Decreases minor amount by the given number. If the number is also expressed as money and it has decimal parts, they will be truncated. If the major component comes from a money object, its currency must match the given money. This check is performed to prevent mistakes; if you need to subtract minor parts of money with different currencies, use (minor x) on the second argument.

    sub-scaled

    added in 1.0.0

    (sub-scaled a)(sub-scaled a b)(sub-scaled a b & more)

    Alias for sub.

    unparse

    added in 1.0.7

    (unparse money)(unparse a b)(unparse a b r)

    Returns a vector with symbolic representations of amount and currency. Useful for printing to EDN or displaying on a console. The letter M will be added to the amount if its precision exceeds 15. For more than one argument the money is created ad-hoc using a and b objects passed to the function named value.

    with-currency

    macro

    added in 1.0.0

    (with-currency currency & body)

    Sets a default currency in a lexical context of the body. Has the same effect as io.randomseed.bankster.currency/with.

    with-rescaling

    macro

    added in 1.0.0

    (with-rescaling rounding-mode & body)

    Alias for io.randomseed.bankster.scale/with-rescaling.

    with-rounding

    macro

    added in 1.0.0

    (with-rounding rounding-mode & body)

    Alias for io.randomseed.bankster.scale/with-rounding.

    zero?

    added in 1.2.0

    (zero? a)

    Alias for is-zero?.

    \ No newline at end of file diff --git a/docs/io.randomseed.bankster.money.inter-ops.html b/docs/io.randomseed.bankster.money.inter-ops.html index c2f1f35..fdc9a90 100644 --- a/docs/io.randomseed.bankster.money.inter-ops.html +++ b/docs/io.randomseed.bankster.money.inter-ops.html @@ -1,3 +1,3 @@ -io.randomseed.bankster.money.inter-ops documentation

    io.randomseed.bankster.money.inter-ops

    *

    added in 1.0.0

    (*)(* a)(* a b)(* a b & more)

    Calls io.randomseed.bankster.money/mul for Money argument, clojure.core/* for other data types.

    +

    added in 1.0.0

    (+)(+ a)(+ a b)(+ a b & more)

    Calls io.randomseed.bankster.money/add for Money argument, clojure.core/+ for other data types.

    -

    added in 1.0.0

    (- a)(- a b)(- a b & more)

    Calls io.randomseed.bankster.money/sub for Money argument, clojure.core/- for other data types.

    /

    added in 1.0.0

    (/ a)(/ a b)(/ a b & more)

    Calls io.randomseed.bankster.money/div for Money argument, clojure.core// for other data types.

    <

    added in 1.0.0

    (< a)(< a b)(< a b & more)

    Calls io.randomseed.bankster.money/lt? for Money argument, clojure.core/> for other data types.

    <=

    added in 1.0.0

    (<= a)(<= a b)(<= a b & more)

    Calls io.randomseed.bankster.money/le? for Money argument, clojure.core/<= for other data types.

    =

    added in 1.0.0

    (= a)(= a b)(= a b & more)

    Calls io.randomseed.bankster.money/eq? for Money argument, clojure.core/= for other data types.

    >

    added in 1.0.0

    (> a)(> a b)(> a b & more)

    Calls io.randomseed.bankster.money/gt? for Money argument, clojure.core/> for other data types.

    >=

    added in 1.0.0

    (>= a)(>= a b)(>= a b & more)

    Calls io.randomseed.bankster.money/ge? for Money argument, clojure.core/>= for other data types.

    compare

    added in 1.0.0

    (compare a b)

    Calls io.randomseed.bankster.money/compare for Money argument, clojure.core/compare for other data types.

    double

    added in 1.0.0

    (double a)

    Calls io.randomseed.bankster.money/->double for Money argument, clojure.core/double for other data types.

    float

    added in 1.0.0

    (float a)

    Calls io.randomseed.bankster.money/->float for Money argument, clojure.core/float for other data types.

    fractional

    (fractional a)(fractional a scale)(fractional a scale rounding-mode)

    Alias for io.randomseed.bankster.scale/fractional.

    int

    added in 1.0.0

    (int a)

    Calls io.randomseed.bankster.money/major->int for Money argument, clojure.core/int for other data types.

    integer

    (integer a)(integer a scale)(integer a scale rounding-mode)

    Alias for io.randomseed.bankster.scale/integer.

    long

    added in 1.0.0

    (long a)

    Calls io.randomseed.bankster.money/major->long for Money argument, clojure.core/long for other data types.

    major

    (major a)

    Alias for io.randomseed.bankster.money/major.

    minor

    (minor a)

    Alias for io.randomseed.bankster.money/minor.

    neg?

    added in 1.0.0

    (neg? a)

    Calls io.randomseed.bankster.money/is-neg? for Money argument, clojure.core/neg? for other data types.

    not=

    added in 1.0.0

    (not= a)(not= a b)(not= a b & more)

    Calls io.randomseed.bankster.money/ne? for Money argument, clojure.core/not= for other data types.

    pos?

    added in 1.0.0

    (pos? a)

    Calls io.randomseed.bankster.money/is-pos? for Money argument, clojure.core/pos? for other data types.

    \ No newline at end of file +io.randomseed.bankster.money.inter-ops documentation

    io.randomseed.bankster.money.inter-ops

    *

    added in 1.0.0

    (*)(* a)(* a b)(* a b & more)

    Calls io.randomseed.bankster.money/mul for Money argument, clojure.core/* for other data types.

    +

    added in 1.0.0

    (+)(+ a)(+ a b)(+ a b & more)

    Calls io.randomseed.bankster.money/add for Money argument, clojure.core/+ for other data types.

    -

    added in 1.0.0

    (- a)(- a b)(- a b & more)

    Calls io.randomseed.bankster.money/sub for Money argument, clojure.core/- for other data types.

    /

    added in 1.0.0

    (/ a)(/ a b)(/ a b & more)

    Calls io.randomseed.bankster.money/div for Money argument, clojure.core// for other data types.

    <

    added in 1.0.0

    (< a)(< a b)(< a b & more)

    Calls io.randomseed.bankster.money/lt? for Money argument, clojure.core/> for other data types.

    <=

    added in 1.0.0

    (<= a)(<= a b)(<= a b & more)

    Calls io.randomseed.bankster.money/le? for Money argument, clojure.core/<= for other data types.

    =

    added in 1.0.0

    (= a)(= a b)(= a b & more)

    Calls io.randomseed.bankster.money/eq? for Money argument, clojure.core/= for other data types.

    >

    added in 1.0.0

    (> a)(> a b)(> a b & more)

    Calls io.randomseed.bankster.money/gt? for Money argument, clojure.core/> for other data types.

    >=

    added in 1.0.0

    (>= a)(>= a b)(>= a b & more)

    Calls io.randomseed.bankster.money/ge? for Money argument, clojure.core/>= for other data types.

    compare

    added in 1.0.0

    (compare a b)

    Calls io.randomseed.bankster.money/compare for Money argument, clojure.core/compare for other data types.

    double

    added in 1.0.0

    (double a)

    Calls io.randomseed.bankster.money/->double for Money argument, clojure.core/double for other data types.

    float

    added in 1.0.0

    (float a)

    Calls io.randomseed.bankster.money/->float for Money argument, clojure.core/float for other data types.

    fractional

    (fractional a)(fractional a scale)(fractional a scale rounding-mode)

    Alias for io.randomseed.bankster.scale/fractional.

    int

    added in 1.0.0

    (int a)

    Calls io.randomseed.bankster.money/major->int for Money argument, clojure.core/int for other data types.

    integer

    (integer a)(integer a scale)(integer a scale rounding-mode)

    Alias for io.randomseed.bankster.scale/integer.

    long

    added in 1.0.0

    (long a)

    Calls io.randomseed.bankster.money/major->long for Money argument, clojure.core/long for other data types.

    major

    (major a)

    Alias for io.randomseed.bankster.money/major.

    minor

    (minor a)

    Alias for io.randomseed.bankster.money/minor.

    neg?

    added in 1.0.0

    (neg? a)

    Calls io.randomseed.bankster.money/is-neg? for Money argument, clojure.core/neg? for other data types.

    not=

    added in 1.0.0

    (not= a)(not= a b)(not= a b & more)

    Calls io.randomseed.bankster.money/ne? for Money argument, clojure.core/not= for other data types.

    pos?

    added in 1.0.0

    (pos? a)

    Calls io.randomseed.bankster.money/is-pos? for Money argument, clojure.core/pos? for other data types.

    \ No newline at end of file diff --git a/docs/io.randomseed.bankster.money.ops.html b/docs/io.randomseed.bankster.money.ops.html index 802eaeb..68f7ccb 100644 --- a/docs/io.randomseed.bankster.money.ops.html +++ b/docs/io.randomseed.bankster.money.ops.html @@ -1,3 +1,3 @@ -io.randomseed.bankster.money.ops documentation

    io.randomseed.bankster.money.ops

    *

    added in 1.0.0

    (*)(* a)(* a b)(* a b & more)

    Alias for io.randomseed.bankster.money/multiply.

    +

    added in 1.0.0

    (+)(+ a)(+ a b)(+ a b & more)

    Alias for io.randomseed.bankster.money/add.

    -

    added in 1.0.0

    (- a)(- a b)(- a b & more)

    Alias for io.randomseed.bankster.money/subtract.

    /

    added in 1.0.0

    (/ a)(/ a b)(/ a b & more)

    Alias for io.randomseed.bankster.money/divide.

    <

    added in 1.0.0

    (< a)(< a b)(< a b & more)

    Alias for io.randomseed.bankster.money/lt?.

    <=

    added in 1.0.0

    (<= a)(<= a b)(<= a b & more)

    Alias for io.randomseed.bankster.money/le?.

    =

    added in 1.0.0

    (=)(= a)(= a b)(= a b & more)

    Alias for io.randomseed.bankster.money/eq?.

    >

    added in 1.0.0

    (> a)(> a b)(> a b & more)

    Alias for io.randomseed.bankster.money/gt?.

    >=

    added in 1.0.0

    (>= a)(>= a b)(>= a b & more)

    Alias for io.randomseed.bankster.money/ge?.

    compare

    added in 1.0.0

    (compare a b)

    Alias for io.randomseed.bankster.money/compare.

    double

    added in 1.0.0

    (double a)

    Alias for io.randomseed.bankster.money/->double.

    float

    added in 1.0.0

    (float a)

    Alias for io.randomseed.bankster.money/->float.

    fractional

    added in 1.0.0

    (fractional a)(fractional a scale)(fractional a scale rounding-mode)

    Alias for io.randomseed.bankster.scale/fractional.

    int

    added in 1.0.0

    (int a)

    Alias for io.randomseed.bankster.money/major->int.

    integer

    added in 1.0.0

    (integer a)(integer a scale)(integer a scale rounding-mode)

    Alias for io.randomseed.bankster.scale/integer.

    long

    added in 1.0.0

    (long a)

    Alias for io.randomseed.bankster.money/major->long.

    major

    added in 1.0.0

    (major a)

    Alias for io.randomseed.bankster.money/major.

    minor

    added in 1.0.0

    (minor a)

    Alias for io.randomseed.bankster.money/minor.

    neg?

    added in 1.0.0

    (neg? a)

    Alias for io.randomseed.bankster.money/is-neg?.

    not=

    added in 1.0.0

    (not=)(not= a)(not= a b)(not= a b & more)

    Alias for io.randomseed.bankster.money/ne?.

    pos?

    added in 1.0.0

    (pos? a)

    Alias for io.randomseed.bankster.money/is-pos?.

    \ No newline at end of file +io.randomseed.bankster.money.ops documentation

    io.randomseed.bankster.money.ops

    *

    added in 1.0.0

    (*)(* a)(* a b)(* a b & more)

    Alias for io.randomseed.bankster.money/multiply.

    +

    added in 1.0.0

    (+)(+ a)(+ a b)(+ a b & more)

    Alias for io.randomseed.bankster.money/add.

    -

    added in 1.0.0

    (- a)(- a b)(- a b & more)

    Alias for io.randomseed.bankster.money/subtract.

    /

    added in 1.0.0

    (/ a)(/ a b)(/ a b & more)

    Alias for io.randomseed.bankster.money/divide.

    <

    added in 1.0.0

    (< a)(< a b)(< a b & more)

    Alias for io.randomseed.bankster.money/lt?.

    <=

    added in 1.0.0

    (<= a)(<= a b)(<= a b & more)

    Alias for io.randomseed.bankster.money/le?.

    =

    added in 1.0.0

    (=)(= a)(= a b)(= a b & more)

    Alias for io.randomseed.bankster.money/eq?.

    >

    added in 1.0.0

    (> a)(> a b)(> a b & more)

    Alias for io.randomseed.bankster.money/gt?.

    >=

    added in 1.0.0

    (>= a)(>= a b)(>= a b & more)

    Alias for io.randomseed.bankster.money/ge?.

    compare

    added in 1.0.0

    (compare a b)

    Alias for io.randomseed.bankster.money/compare.

    double

    added in 1.0.0

    (double a)

    Alias for io.randomseed.bankster.money/->double.

    float

    added in 1.0.0

    (float a)

    Alias for io.randomseed.bankster.money/->float.

    fractional

    added in 1.0.0

    (fractional a)(fractional a scale)(fractional a scale rounding-mode)

    Alias for io.randomseed.bankster.scale/fractional.

    int

    added in 1.0.0

    (int a)

    Alias for io.randomseed.bankster.money/major->int.

    integer

    added in 1.0.0

    (integer a)(integer a scale)(integer a scale rounding-mode)

    Alias for io.randomseed.bankster.scale/integer.

    long

    added in 1.0.0

    (long a)

    Alias for io.randomseed.bankster.money/major->long.

    major

    added in 1.0.0

    (major a)

    Alias for io.randomseed.bankster.money/major.

    minor

    added in 1.0.0

    (minor a)

    Alias for io.randomseed.bankster.money/minor.

    neg?

    added in 1.0.0

    (neg? a)

    Alias for io.randomseed.bankster.money/is-neg?.

    not=

    added in 1.0.0

    (not=)(not= a)(not= a b)(not= a b & more)

    Alias for io.randomseed.bankster.money/ne?.

    pos?

    added in 1.0.0

    (pos? a)

    Alias for io.randomseed.bankster.money/is-pos?.

    \ No newline at end of file diff --git a/docs/io.randomseed.bankster.registry.html b/docs/io.randomseed.bankster.registry.html index 2e01043..cf00f60 100644 --- a/docs/io.randomseed.bankster.registry.html +++ b/docs/io.randomseed.bankster.registry.html @@ -1,3 +1,3 @@ -io.randomseed.bankster.registry documentation

    io.randomseed.bankster.registry

    *default*

    dynamic

    added in 1.0.0

    Registry, that if set to a truthy value (not nil and not false), will be used instead of a global, shared registry.

    country-id->currency

    macro

    added in 1.0.0

    (country-id->currency)(country-id->currency registry)

    Returns the country ID to currency map from a registry. If the registry is not given the dynamic variable default is tried. If it is not set, current state of a global registry is used instead.

    currency-code->currencies

    macro

    added in 1.0.0

    (currency-code->currencies)(currency-code->currencies registry)

    Returns the currency short-code to currencies map from a registry. If the registry is not given the dynamic variable default is tried. If it is not set, current state of a global registry is used instead.

    currency-id->country-ids

    macro

    added in 1.0.0

    (currency-id->country-ids)(currency-id->country-ids registry)

    Returns the currency ID to country IDs map from a registry. If the registry is not given the dynamic variable default is tried. If it is not set, current state of a global registry is used instead.

    currency-id->currency

    macro

    added in 1.0.0

    (currency-id->currency)(currency-id->currency registry)

    Returns the currency ID to currency map from a registry. If the registry is not given the dynamic variable default is tried. If it is not set, current state of a global registry is used instead.

    currency-id->localized

    macro

    added in 1.0.0

    (currency-id->localized)(currency-id->localized registry)

    Returns the currency ID to localized propertied map from a registry. If the registry is not given the dynamic variable default is tried. If it is not set, current state of a global registry is used instead.

    currency-nr->currency

    macro

    added in 1.0.0

    (currency-nr->currency)(currency-nr->currency registry)

    Returns the currency number to currency map from a registry. If the registry is not given the dynamic variable default is tried. If it is not set, current state of a global registry is used instead.

    default-version

    added in 1.0.0

    (default-version)

    get

    macro

    added in 1.0.0

    (get)

    Gets the current state of a global registry. If the dynamic variable default is set to a truthy value, it will be used instead.

    global

    added in 1.0.0

    (global)

    Returns global registry object.

    new

    added in 1.0.0

    (new)(new cur-id->cur cur-nr->cur ctr-id->cur cur-id->ctr-ids cur-id->localized cur-code->curs version)(new cur-id->cur cur-nr->cur ctr-id->cur cur-id->ctr-ids cur-id->localized cur-code->curs)(new cur-id->cur ctr-id->cur cur-id->localized cur-code->curs version)(new cur-id->cur ctr-id->cur cur-id->localized cur-code->curs)(new m)

    Alias for new-registry.

    new-registry

    added in 1.0.0

    (new-registry)(new-registry cur-id->cur cur-nr->cur ctr-id->cur cur-id->ctr-ids cur-id->localized cur-code->curs version)(new-registry cur-id->cur cur-nr->cur ctr-id->cur cur-id->ctr-ids cur-id->localized cur-code->curs)(new-registry cur-id->cur ctr-id->cur cur-id->localized cur-code->curs version)(new-registry cur-id->cur ctr-id->cur cur-id->localized cur-code->curs)(new-registry m)

    Creates a new registry.

    R

    added in 1.0.0

    Global registry object based on an Atom.

    registry?

    added in 1.0.0

    (registry? obj)

    Returns true if the given object is a registry.

    set!

    added in 1.0.0

    (set! registry)(set! cur-id->cur cur-nr->cur ctr-id->cur cur-id->ctr-ids cur-id->localized cur-code->curs)(set! cur-id->cur cur-nr->cur ctr-id->cur cur-id->ctr-ids cur-id->localized cur-code->curs version)

    Sets current state of a global registry.

    state

    added in 1.0.0

    (state)

    Returns current state of a global registry.

    update

    added in 1.0.0

    (update r fun & more)

    Updates a registry with a function that should take a registry as its first argument and return the updated one. It is a simple apply-based implementation provided for the sake of symmetry with update! which operates on a global registry object.

    update!

    added in 1.0.0

    (update! fun & more)

    Updates a global registry using a function that should take a registry and return the updated version of it.

    with

    macro

    added in 1.0.0

    (with registry & body)

    Sets a registry in a lexical context of the body to be used instead of a global one in functions which require the registry and it was not passed as an argument.

    \ No newline at end of file +io.randomseed.bankster.registry documentation

    io.randomseed.bankster.registry

    *default*

    dynamic

    added in 1.0.0

    Registry, that if set to a truthy value (not nil and not false), will be used instead of a global, shared registry.

    country-id->currency

    macro

    added in 1.0.0

    (country-id->currency)(country-id->currency registry)

    Returns the country ID to currency map from a registry. If the registry is not given the dynamic variable default is tried. If it is not set, current state of a global registry is used instead.

    currency-code->currencies

    macro

    added in 1.0.0

    (currency-code->currencies)(currency-code->currencies registry)

    Returns the currency short-code to currencies map from a registry. If the registry is not given the dynamic variable default is tried. If it is not set, current state of a global registry is used instead.

    currency-id->country-ids

    macro

    added in 1.0.0

    (currency-id->country-ids)(currency-id->country-ids registry)

    Returns the currency ID to country IDs map from a registry. If the registry is not given the dynamic variable default is tried. If it is not set, current state of a global registry is used instead.

    currency-id->currency

    macro

    added in 1.0.0

    (currency-id->currency)(currency-id->currency registry)

    Returns the currency ID to currency map from a registry. If the registry is not given the dynamic variable default is tried. If it is not set, current state of a global registry is used instead.

    currency-id->localized

    macro

    added in 1.0.0

    (currency-id->localized)(currency-id->localized registry)

    Returns the currency ID to localized propertied map from a registry. If the registry is not given the dynamic variable default is tried. If it is not set, current state of a global registry is used instead.

    currency-nr->currency

    macro

    added in 1.0.0

    (currency-nr->currency)(currency-nr->currency registry)

    Returns the currency number to currency map from a registry. If the registry is not given the dynamic variable default is tried. If it is not set, current state of a global registry is used instead.

    default-version

    added in 1.0.0

    (default-version)

    get

    macro

    added in 1.0.0

    (get)

    Gets the current state of a global registry. If the dynamic variable default is set to a truthy value, it will be used instead.

    global

    added in 1.0.0

    (global)

    Returns global registry object.

    new

    added in 1.0.0

    (new)(new cur-id->cur cur-nr->cur ctr-id->cur cur-id->ctr-ids cur-id->localized cur-code->curs version)(new cur-id->cur cur-nr->cur ctr-id->cur cur-id->ctr-ids cur-id->localized cur-code->curs)(new cur-id->cur ctr-id->cur cur-id->localized cur-code->curs version)(new cur-id->cur ctr-id->cur cur-id->localized cur-code->curs)(new m)

    Alias for new-registry.

    new-registry

    added in 1.0.0

    (new-registry)(new-registry cur-id->cur cur-nr->cur ctr-id->cur cur-id->ctr-ids cur-id->localized cur-code->curs version)(new-registry cur-id->cur cur-nr->cur ctr-id->cur cur-id->ctr-ids cur-id->localized cur-code->curs)(new-registry cur-id->cur ctr-id->cur cur-id->localized cur-code->curs version)(new-registry cur-id->cur ctr-id->cur cur-id->localized cur-code->curs)(new-registry m)

    Creates a new registry.

    R

    added in 1.0.0

    Global registry object based on an Atom.

    registry?

    added in 1.0.0

    (registry? obj)

    Returns true if the given object is a registry.

    set!

    added in 1.0.0

    (set! registry)(set! cur-id->cur cur-nr->cur ctr-id->cur cur-id->ctr-ids cur-id->localized cur-code->curs)(set! cur-id->cur cur-nr->cur ctr-id->cur cur-id->ctr-ids cur-id->localized cur-code->curs version)

    Sets current state of a global registry.

    state

    added in 1.0.0

    (state)

    Returns current state of a global registry.

    update

    added in 1.0.0

    (update r fun & more)

    Updates a registry with a function that should take a registry as its first argument and return the updated one. It is a simple apply-based implementation provided for the sake of symmetry with update! which operates on a global registry object.

    update!

    added in 1.0.0

    (update! fun & more)

    Updates a global registry using a function that should take a registry and return the updated version of it.

    with

    macro

    added in 1.0.0

    (with registry & body)

    Sets a registry in a lexical context of the body to be used instead of a global one in functions which require the registry and it was not passed as an argument.

    \ No newline at end of file diff --git a/docs/io.randomseed.bankster.scale.html b/docs/io.randomseed.bankster.scale.html index f0f4221..6f30a76 100644 --- a/docs/io.randomseed.bankster.scale.html +++ b/docs/io.randomseed.bankster.scale.html @@ -1,9 +1,9 @@ -io.randomseed.bankster.scale documentation

    io.randomseed.bankster.scale

    *each*

    dynamic

    added in 1.0.0

    Enables re-scaling after each consecutive operation.

    *rounding-mode*

    dynamic

    added in 1.0.0

    Default rounding mode.

    ->double

    added in 1.1.0

    (->double n)(->double n scale)(->double n rounding-mode)(->double n scale rounding-mode)

    Converts to a double with optional rescaling and rounding. If the precision of double is to small to express the value, rounding must be provided (either explicitly or using rounding-mode), otherwise an exception will be thrown.

    ->float

    added in 1.1.0

    (->float n)(->float n scale)(->float n rounding-mode)(->float n scale rounding-mode)

    Converts to a float with optional rescaling and rounding. If the precision of float is to small to express the value, rounding must be provided (either explicitly or using rounding-mode), otherwise an exception will be thrown.

    ->int

    added in 1.0.0

    (->int n)(->int n rounding-mode)

    Converts to an int with optional rounding.

    ->long

    added in 1.0.0

    (->long n)(->long n rounding-mode)

    Converts to a long with optional rounding.

    div-math-context

    (div-math-context a b)(div-math-context a b rounding-mode)

    Returns the MathContext set to handle the possible precision for the operation of dividing two BigDecimal numbers. Optional rounding mode may be provided.

    div-max-precision

    added in 1.0.0

    (div-max-precision a b)

    Returns the maximum possible precision for the operation of dividing two BigDecimal numbers.

    each

    macro

    added in 1.0.0

    (each & body)

    Enables re-scaling on some consecutive operations which support it and sets the rounding mode for operations on scaled values. Internally sets rescale-each to true and rounding-mode to the given value.

    -

    Practically, in most cases it is better to use the with-rescaling macro which also sets rounding mode.

    fractional

    added in 1.0.0

    (fractional n)(fractional n scale)(fractional n scale rounding-mode)

    Returns the fractional part of the given number, converted to decimal if required. Optional scale and rounding mode can be given. Makes use of rounding-mode if it’s set.

    integer

    added in 1.0.0

    (integer n)(integer n scale)(integer n scale rounding-mode)

    Returns the integer part of the given number, converted to decimal if required. Optional scale and rounding mode can be given. Makes use of rounding-mode if it’s set.

    ROUND_CEILING

    added in 1.0.0

    Rounding mode to round towards positive infinity.

    ROUND_DOWN

    added in 1.0.0

    Rounding mode to round towards zero.

    ROUND_FLOOR

    added in 1.0.0

    Rounding mode to round towards negative infinity.

    ROUND_HALF_DOWN

    added in 1.0.0

    Rounding mode to round towards nearest neighbor, unless neighbors are equidistant, in which case round down.

    ROUND_HALF_EVEN

    added in 1.0.0

    Rounding mode to round towards nearest neighbor, unless neighbors are equidistant, in which case round towards the nearest one.

    ROUND_HALF_UP

    added in 1.0.0

    Rounding mode to round towards nearest neighbor, unless neighbors are equidistant, in which case round up.

    ROUND_UNNECESSARY

    added in 1.0.0

    Indication that no rounding is necessary.

    ROUND_UP

    added in 1.0.0

    Rounding mode to round away from zero.

    Scalable

    protocol

    added in 1.0.0

    The Scalable protocol describes values that can be scaled.

    members

    amount

    added in 1.0.0

    (amount num)(amount num scale)(amount num scale rounding-mode)

    Returns the amount of a scalable as a BigDecimal number. Some scalables may not be purely numeric so this function is to get the actual, calculable value out of them.

    applied?

    added in 1.0.0

    (applied? num)

    Returns true if the value is of type which contains scaling information.

    apply

    (apply num)(apply num scale)(apply num scale rounding-mode)

    Converts the given value to a scalable with or without changing its scale. For values that already are scalable it changes their scales if called with a second argument. The third argument, rounding-mode, must be present when downscaling and rounding is needed. For compound values (like monetary amounts) it will rescale the amount but will NOT update scale information of the unit (e.g. currency component).

    -

    When operating on Money objects and called with a single argument, it reapplies the nominal currency scale.

    of

    added in 1.0.0

    (of num)

    Returns a scale. If the given value is not of type that scales (or is used to produce scaled types) it will be converted to such.

    scalable?

    added in 1.0.0

    (scalable? num)

    Returns true if the value can be converted to a scalable.

    to-clojure-string

    added in 1.1.0

    (to-clojure-string n)

    Converts the amount to a plain string, adding the M suffix when needed.

    to-clojure-symbol

    added in 1.1.0

    (to-clojure-symbol n)

    Converts the amount to a symbol, adding the M suffix when needed.

    to-plain-string

    added in 1.0.7

    (to-plain-string n)

    Converts the amount to a plain string.

    to-symbol

    added in 1.1.0

    (to-symbol n)

    Converts the amount to a symbol.

    unscaled-context

    added in 1.0.0

    MathContext indicating auto-scaling and no rounding.

    with

    added in 1.0.0

    (with num)(with num scale)(with num scale rounding-mode)

    Alias for scale/apply.

    with-rescaling

    macro

    added in 1.0.0

    (with-rescaling rounding-mode & body)

    Enables re-scaling on some consecutive operations which support it and sets the rounding mode for operations on scaled values. Internally sets *each* to true and *rounding-mode* to the given value.

    +io.randomseed.bankster.scale documentation

    io.randomseed.bankster.scale

    *each*

    dynamic

    added in 1.0.0

    Enables re-scaling after each consecutive operation.

    *rounding-mode*

    dynamic

    added in 1.0.0

    Default rounding mode.

    ->double

    added in 1.1.0

    (->double n)(->double n scale)(->double n rounding-mode)(->double n scale rounding-mode)

    Converts to a double with optional rescaling and rounding. If the precision of double is to small to express the value, rounding must be provided (either explicitly or using rounding-mode), otherwise an exception will be thrown.

    ->float

    added in 1.1.0

    (->float n)(->float n scale)(->float n rounding-mode)(->float n scale rounding-mode)

    Converts to a float with optional rescaling and rounding. If the precision of float is to small to express the value, rounding must be provided (either explicitly or using rounding-mode), otherwise an exception will be thrown.

    ->int

    added in 1.0.0

    (->int n)(->int n rounding-mode)

    Converts to an int with optional rounding.

    ->long

    added in 1.0.0

    (->long n)(->long n rounding-mode)

    Converts to a long with optional rounding.

    div-math-context

    (div-math-context a b)(div-math-context a b rounding-mode)

    Returns the MathContext set to handle the possible precision for the operation of dividing two BigDecimal numbers. Optional rounding mode may be provided.

    div-max-precision

    added in 1.0.0

    (div-max-precision a b)

    Returns the maximum possible precision for the operation of dividing two BigDecimal numbers.

    each

    macro

    added in 1.0.0

    (each & body)

    Enables re-scaling on some consecutive operations which support it and sets the rounding mode for operations on scaled values. Internally sets rescale-each to true and rounding-mode to the given value.

    +

    Practically, in most cases it is better to use the with-rescaling macro which also sets rounding mode.

    fractional

    added in 1.0.0

    (fractional n)(fractional n scale)(fractional n scale rounding-mode)

    Returns the fractional part of the given number, converted to decimal if required. Optional scale and rounding mode can be given. Makes use of rounding-mode if it’s set.

    integer

    added in 1.0.0

    (integer n)(integer n scale)(integer n scale rounding-mode)

    Returns the integer part of the given number, converted to decimal if required. Optional scale and rounding mode can be given. Makes use of rounding-mode if it’s set.

    ROUND_CEILING

    added in 1.0.0

    Rounding mode to round towards positive infinity.

    ROUND_DOWN

    added in 1.0.0

    Rounding mode to round towards zero.

    ROUND_FLOOR

    added in 1.0.0

    Rounding mode to round towards negative infinity.

    ROUND_HALF_DOWN

    added in 1.0.0

    Rounding mode to round towards nearest neighbor, unless neighbors are equidistant, in which case round down.

    ROUND_HALF_EVEN

    added in 1.0.0

    Rounding mode to round towards nearest neighbor, unless neighbors are equidistant, in which case round towards the nearest one.

    ROUND_HALF_UP

    added in 1.0.0

    Rounding mode to round towards nearest neighbor, unless neighbors are equidistant, in which case round up.

    ROUND_UNNECESSARY

    added in 1.0.0

    Indication that no rounding is necessary.

    ROUND_UP

    added in 1.0.0

    Rounding mode to round away from zero.

    Scalable

    protocol

    added in 1.0.0

    The Scalable protocol describes values that can be scaled.

    members

    amount

    added in 1.0.0

    (amount num)(amount num scale)(amount num scale rounding-mode)

    Returns the amount of a scalable as a BigDecimal number. Some scalables may not be purely numeric so this function is to get the actual, calculable value out of them.

    applied?

    added in 1.0.0

    (applied? num)

    Returns true if the value is of type which contains scaling information.

    apply

    (apply num)(apply num scale)(apply num scale rounding-mode)

    Converts the given value to a scalable with or without changing its scale. For values that already are scalable it changes their scales if called with a second argument. The third argument, rounding-mode, must be present when downscaling and rounding is needed. For compound values (like monetary amounts) it will rescale the amount but will NOT update scale information of the unit (e.g. currency component).

    +

    When operating on Money objects and called with a single argument, it reapplies the nominal currency scale.

    of

    added in 1.0.0

    (of num)

    Returns a scale. If the given value is not of type that scales (or is used to produce scaled types) it will be converted to such.

    scalable?

    added in 1.0.0

    (scalable? num)

    Returns true if the value can be converted to a scalable.

    to-clojure-string

    added in 1.1.0

    (to-clojure-string n)

    Converts the amount to a plain string, adding the M suffix when needed.

    to-clojure-symbol

    added in 1.1.0

    (to-clojure-symbol n)

    Converts the amount to a symbol, adding the M suffix when needed.

    to-plain-string

    added in 1.0.7

    (to-plain-string n)

    Converts the amount to a plain string.

    to-symbol

    added in 1.1.0

    (to-symbol n)

    Converts the amount to a symbol.

    unscaled-context

    added in 1.0.0

    MathContext indicating auto-scaling and no rounding.

    with

    added in 1.0.0

    (with num)(with num scale)(with num scale rounding-mode)

    Alias for scale/apply.

    with-rescaling

    macro

    added in 1.0.0

    (with-rescaling rounding-mode & body)

    Enables re-scaling on some consecutive operations which support it and sets the rounding mode for operations on scaled values. Internally sets *each* to true and *rounding-mode* to the given value.

    The first argument should be a valid rounding (from io.randomseed.bankster.scale or java.math.RoundingMode) or one of the following:

    -

    CEILING - rounds towards positive infinity. DOWN - rounds towards zero. FLOOR - rounds towards negative infinity. HALF_DOWN - rounds towards nearest neighbor unless both neighbors are equidistant, in which case rounds down. HALF_EVEN - rounds towards the nearest neighbor unless both neighbors are equidistant, and if so, rounds towards the even. HALF_UP - rounds towards the nearest neighbor unless both neighbors are equidistant, and if so, rounds up. UP – rounds away from zero UNNECESSARY - asserts that the requested operation has an exact result, hence no rounding is necessary.

    with-rounding

    macro

    added in 1.0.0

    (with-rounding rounding-mode & body)

    Sets the rounding mode for operations on scaled values.

    +

    CEILING - rounds towards positive infinity. DOWN - rounds towards zero. FLOOR - rounds towards negative infinity. HALF_DOWN - rounds towards nearest neighbor unless both neighbors are equidistant, in which case rounds down. HALF_EVEN - rounds towards the nearest neighbor unless both neighbors are equidistant, and if so, rounds towards the even. HALF_UP - rounds towards the nearest neighbor unless both neighbors are equidistant, and if so, rounds up. UP – rounds away from zero UNNECESSARY - asserts that the requested operation has an exact result, hence no rounding is necessary.

    with-rounding

    macro

    added in 1.0.0

    (with-rounding rounding-mode & body)

    Sets the rounding mode for operations on scaled values.

    The first argument should be a valid rounding (from io.randomseed.bankster.scale or java.math.RoundingMode) or one of the following:

    -

    CEILING - rounds towards positive infinity. DOWN - rounds towards zero. FLOOR - rounds towards negative infinity. HALF_DOWN - rounds towards nearest neighbor unless both neighbors are equidistant, in which case rounds down. HALF_EVEN - rounds towards the nearest neighbor unless both neighbors are equidistant, and if so, rounds towards the even. HALF_UP - rounds towards the nearest neighbor unless both neighbors are equidistant, and if so, rounds up. UP – rounds away from zero UNNECESSARY - asserts that the requested operation has an exact result, hence no rounding is necessary.

    \ No newline at end of file +

    CEILING - rounds towards positive infinity. DOWN - rounds towards zero. FLOOR - rounds towards negative infinity. HALF_DOWN - rounds towards nearest neighbor unless both neighbors are equidistant, in which case rounds down. HALF_EVEN - rounds towards the nearest neighbor unless both neighbors are equidistant, and if so, rounds towards the even. HALF_UP - rounds towards the nearest neighbor unless both neighbors are equidistant, and if so, rounds up. UP – rounds away from zero UNNECESSARY - asserts that the requested operation has an exact result, hence no rounding is necessary.

    \ No newline at end of file diff --git a/docs/io.randomseed.bankster.util.fs.html b/docs/io.randomseed.bankster.util.fs.html index 6028f7d..d1ff997 100644 --- a/docs/io.randomseed.bankster.util.fs.html +++ b/docs/io.randomseed.bankster.util.fs.html @@ -1,3 +1,3 @@ -io.randomseed.bankster.util.fs documentation

    io.randomseed.bankster.util.fs

    absolute-path?

    (absolute-path? pathname)

    default-encoding

    Default encoding for input files.

    empty-str-ary

    get-java-classpath-folders

    (get-java-classpath-folders)

    Lists all directories which exist in Java classpath as a sequence of strings. Returns nil if there are none.

    get-resource

    added in 1.2.4

    (get-resource pname)

    For the given pathname, returns the resource URL if the path exists. If the path does not exist, returns nil.

    home-dir-pathname

    (home-dir-pathname)(home-dir-pathname & paths)

    For the given pathnames creates a pathname expressed as a string by prefixing them with user’s home directory obtained from the Java property user.dir with all parts joined using current path name separator.

    integer-string?

    (integer-string? s)

    Returns true if string contains valid integer number.

    paths->resource

    added in 1.0.0

    (paths->resource)(paths->resource & paths)

    For the given pathnames creates a resource object that resides within one of the Java resource directories. The resource must exist for the URI to be returned.

    prop-pathname

    (prop-pathname prop)(prop-pathname prop paths)

    For the given Java property name and optional path names creates a path name expressed as a string by prefixing them with the directory obtained from a property with all parts joined using pathname separator.

    read-csv

    (read-csv resource)

    Reads CSV file and returns a lazy sequence of rows.

    read-preferences

    (read-preferences filename)(read-preferences filename opts)

    Reads the given preference file. If the path is relative it will be relative to user’s home directory. Optional options map will be passed to EDN reader.

    relative-path?

    resource-pathname

    (resource-pathname)(resource-pathname & paths)

    For the given pathnames creates a pathname expressed as a string that resides within one of the Java resource directories. The path must exist to be returned. WARNING: it will only work for resources on a filesystem, giving you the regular pathname, not URI.

    rtrim-comments

    (rtrim-comments s)

    user-dir-pathname

    (user-dir-pathname)(user-dir-pathname & paths)

    For the given pathnames creates a pathname expressed as a string by prefixing them with user’s directory (typically a project directory) obtained from the Java property user.dir with all parts joined using current path name separator.

    \ No newline at end of file +io.randomseed.bankster.util.fs documentation

    io.randomseed.bankster.util.fs

    absolute-path?

    (absolute-path? pathname)

    default-encoding

    Default encoding for input files.

    empty-str-ary

    get-java-classpath-folders

    (get-java-classpath-folders)

    Lists all directories which exist in Java classpath as a sequence of strings. Returns nil if there are none.

    get-resource

    added in 1.2.4

    (get-resource pname)

    For the given pathname, returns the resource URL if the path exists. If the path does not exist, returns nil.

    home-dir-pathname

    (home-dir-pathname)(home-dir-pathname & paths)

    For the given pathnames creates a pathname expressed as a string by prefixing them with user’s home directory obtained from the Java property user.dir with all parts joined using current path name separator.

    integer-string?

    (integer-string? s)

    Returns true if string contains valid integer number.

    paths->resource

    added in 1.0.0

    (paths->resource)(paths->resource & paths)

    For the given pathnames creates a resource object that resides within one of the Java resource directories. The resource must exist for the URI to be returned.

    prop-pathname

    (prop-pathname prop)(prop-pathname prop paths)

    For the given Java property name and optional path names creates a path name expressed as a string by prefixing them with the directory obtained from a property with all parts joined using pathname separator.

    read-csv

    (read-csv resource)

    Reads CSV file and returns a lazy sequence of rows.

    read-preferences

    (read-preferences filename)(read-preferences filename opts)

    Reads the given preference file. If the path is relative it will be relative to user’s home directory. Optional options map will be passed to EDN reader.

    relative-path?

    resource-pathname

    (resource-pathname)(resource-pathname & paths)

    For the given pathnames creates a pathname expressed as a string that resides within one of the Java resource directories. The path must exist to be returned. WARNING: it will only work for resources on a filesystem, giving you the regular pathname, not URI.

    rtrim-comments

    (rtrim-comments s)

    user-dir-pathname

    (user-dir-pathname)(user-dir-pathname & paths)

    For the given pathnames creates a pathname expressed as a string by prefixing them with user’s directory (typically a project directory) obtained from the Java property user.dir with all parts joined using current path name separator.

    \ No newline at end of file diff --git a/docs/io.randomseed.bankster.util.html b/docs/io.randomseed.bankster.util.html index c6af69a..a4a22c3 100644 --- a/docs/io.randomseed.bankster.util.html +++ b/docs/io.randomseed.bankster.util.html @@ -1,3 +1,3 @@ -io.randomseed.bankster.util documentation

    io.randomseed.bankster.util

    added in 1.0.0

    Support functions and macros.

    bytes-concat

    (bytes-concat)(bytes-concat bary)(bytes-concat bary & byte-arys)

    bytes-to-string

    (bytes-to-string b)

    Converts bytes into a string

    char-ranges->set

    added in 1.0.0

    (char-ranges->set & ranges)

    Returns a set of characters defined as a collection of collections with start and stop character, e.g.: [\A \Z][\0 \9]

    count-digits

    added in 1.0.0

    (count-digits n)

    current-thread

    (current-thread)

    current-thread-id

    (current-thread-id)

    current-thread-name

    (current-thread-name)

    ensure-keyword

    (ensure-keyword id)

    ensure-keyword-having-ns

    (ensure-keyword-having-ns id ns)

    gen-digits

    added in 1.0.0

    (gen-digits num)(gen-digits num rng)

    Generates the given number of random digits and converts all into a single string. When the second argument is present it should be an instance of random number generator used to get the digits.

    get-rand-int

    added in 1.0.0

    (get-rand-int n)(get-rand-int n rng)

    Like rand-int but optionally uses random number generator.

    get-rand-nth

    added in 1.0.0

    (get-rand-nth v)(get-rand-nth v rng)

    Returns a random element of the given vector. When the second argument is present it should be an instance of random number generator used to get the random position.

    inferred-contains?

    added in 1.0.0

    (inferred-contains? coll k)

    Just like the contains? but if the keyword is namespace-qualified it also checks if the collection contains the same keyword as its key but without a namespace.

    inferred-get

    added in 1.0.0

    (inferred-get coll k)(inferred-get coll k default)

    Just like the get function but if the keyword is namespace-qualified it first attempts to look for the value associated with it. If that fails it uses the variant of the keyword without any namespace.

    is

    macro

    (is pred val & body)

    is-not

    macro

    (is-not pred val & body)

    juxt-seq

    (juxt-seq & functions)

    Like juxt but returns a lazy sequence.

    lazy-iterator-seq

    added in 1.0.0

    (lazy-iterator-seq coll)(lazy-iterator-seq coll iter)

    Returns a lazy sequence as an interface to the given iterable Java object.

    must-have-ns

    (must-have-ns id ns)

    ns-infer

    added in 1.0.0

    (ns-infer ns-name k)(ns-infer ns-name k use-infer)

    Takes a string of namespace name and a keyword. If the given keyword is not namespace-qualified it returns a new keyword with the given namespace added. If the given keyword is already equipped with a namespace it returns it.

    random-digits-len

    added in 1.0.0

    (random-digits-len x iteration shrink-now)(random-digits-len x iteration shrink-now rng)

    For 0 or 1 it returns its argument. For other positive numbers it returns a random natural number from 1 to this number (inclusive) in 50% cases. In other 50% cases it returns its argument.

    replace-in-set

    (replace-in-set s old-val new-val)

    some-string

    (some-string s)

    text-to-bytes

    (text-to-bytes t)

    to-bytes

    (to-bytes obj)

    to-long

    (to-long s default)

    try-null

    macro

    added in 1.0.0

    (try-null & body)

    Evaluates body and if NullPointerException exception is caught it returns nil. Otherwise it returns the value of last expression in the body.

    try-parse-int

    (try-parse-int s)

    Returns integer from an object or nil if the given object does not contain valid integer.

    try-parse-long

    (try-parse-long s)

    Returns long from an object or nil if the given object does not contain valid long.

    try-upper-case

    (try-upper-case s)

    uuid

    (uuid s)

    when-not-empty

    macro

    added in 1.0.0

    (when-not-empty val & body)

    Evaluates body when the given value is a non-empty collection.

    with-not-empty

    added in 1.0.0

    (with-not-empty obj)

    Returns the collection if it’s not empty. Otherwise returns nil.

    \ No newline at end of file +io.randomseed.bankster.util documentation

    io.randomseed.bankster.util

    added in 1.0.0

    Support functions and macros.

    bytes-concat

    (bytes-concat)(bytes-concat bary)(bytes-concat bary & byte-arys)

    bytes-to-string

    (bytes-to-string b)

    Converts bytes into a string

    char-ranges->set

    added in 1.0.0

    (char-ranges->set & ranges)

    Returns a set of characters defined as a collection of collections with start and stop character, e.g.: [\A \Z][\0 \9]

    count-digits

    added in 1.0.0

    (count-digits n)

    current-thread

    (current-thread)

    current-thread-id

    (current-thread-id)

    current-thread-name

    (current-thread-name)

    ensure-keyword

    (ensure-keyword id)

    ensure-keyword-having-ns

    (ensure-keyword-having-ns id ns)

    gen-digits

    added in 1.0.0

    (gen-digits num)(gen-digits num rng)

    Generates the given number of random digits and converts all into a single string. When the second argument is present it should be an instance of random number generator used to get the digits.

    get-rand-int

    added in 1.0.0

    (get-rand-int n)(get-rand-int n rng)

    Like rand-int but optionally uses random number generator.

    get-rand-nth

    added in 1.0.0

    (get-rand-nth v)(get-rand-nth v rng)

    Returns a random element of the given vector. When the second argument is present it should be an instance of random number generator used to get the random position.

    inferred-contains?

    added in 1.0.0

    (inferred-contains? coll k)

    Just like the contains? but if the keyword is namespace-qualified it also checks if the collection contains the same keyword as its key but without a namespace.

    inferred-get

    added in 1.0.0

    (inferred-get coll k)(inferred-get coll k default)

    Just like the get function but if the keyword is namespace-qualified it first attempts to look for the value associated with it. If that fails it uses the variant of the keyword without any namespace.

    is

    macro

    (is pred val & body)

    is-not

    macro

    (is-not pred val & body)

    juxt-seq

    (juxt-seq & functions)

    Like juxt but returns a lazy sequence.

    lazy-iterator-seq

    added in 1.0.0

    (lazy-iterator-seq coll)(lazy-iterator-seq coll iter)

    Returns a lazy sequence as an interface to the given iterable Java object.

    must-have-ns

    (must-have-ns id ns)

    ns-infer

    added in 1.0.0

    (ns-infer ns-name k)(ns-infer ns-name k use-infer)

    Takes a string of namespace name and a keyword. If the given keyword is not namespace-qualified it returns a new keyword with the given namespace added. If the given keyword is already equipped with a namespace it returns it.

    random-digits-len

    added in 1.0.0

    (random-digits-len x iteration shrink-now)(random-digits-len x iteration shrink-now rng)

    For 0 or 1 it returns its argument. For other positive numbers it returns a random natural number from 1 to this number (inclusive) in 50% cases. In other 50% cases it returns its argument.

    replace-in-set

    (replace-in-set s old-val new-val)

    some-string

    (some-string s)

    text-to-bytes

    (text-to-bytes t)

    to-bytes

    (to-bytes obj)

    to-long

    (to-long s default)

    try-null

    macro

    added in 1.0.0

    (try-null & body)

    Evaluates body and if NullPointerException exception is caught it returns nil. Otherwise it returns the value of last expression in the body.

    try-parse-int

    (try-parse-int s)

    Returns integer from an object or nil if the given object does not contain valid integer.

    try-parse-long

    (try-parse-long s)

    Returns long from an object or nil if the given object does not contain valid long.

    try-upper-case

    (try-upper-case s)

    uuid

    (uuid s)

    when-not-empty

    macro

    added in 1.0.0

    (when-not-empty val & body)

    Evaluates body when the given value is a non-empty collection.

    with-not-empty

    added in 1.0.0

    (with-not-empty obj)

    Returns the collection if it’s not empty. Otherwise returns nil.

    \ No newline at end of file diff --git a/docs/io.randomseed.bankster.util.importer.html b/docs/io.randomseed.bankster.util.importer.html index 0e5d170..aefcb9f 100644 --- a/docs/io.randomseed.bankster.util.importer.html +++ b/docs/io.randomseed.bankster.util.importer.html @@ -1,8 +1,8 @@ -io.randomseed.bankster.util.importer documentation

    io.randomseed.bankster.util.importer

    countries-load

    added in 1.0.0

    (countries-load)(countries-load pathname)

    Reads CSV file in a format compliant with Joda Money and returns a map with currency to countries associations where countries are as sets. The pathname should be relative to resources directory.

    currencies-load

    added in 1.0.0

    (currencies-load)(currencies-load pathname)

    Reads CSV file compliant with Joda Money and returns a map with currency ID (keyword) as a key and currency data as its value (vector). The pathname should be relative to resources directory.

    currency->map

    added in 1.0.0

    (currency->map {:keys [:numeric :scale :kind :weight]})

    Takes a currency and returns a map suitable for putting into a configuration file. Extensions fields are ignored.

    default-countries-csv

    added in 1.0.0

    Default CSV file with countries database.

    default-currencies-csv

    added in 1.0.0

    Default CSV file with currencies database.

    default-data-reader-filename

    added in 1.2.4

    Default data reader filename (pure data).

    default-dump-filename

    added in 1.0.0

    Default EDN dump file.

    default-export-filename

    added in 1.0.0

    Default EDN export file.

    default-handlers-namespace

    added in 1.0.0

    Default namespace of a reader handlers.

    default-handlers-pathname

    added in 1.0.0

    Default pathname of a reader handlers file.

    default-reader-filenames

    added in 1.0.0

    Default data reader filenames (Clojure code).

    default-resource-must-exist-file

    added in 1.0.0

    Filename in a default resource container that must exist.

    default-resource-name

    added in 1.0.0

    Name of a default resource container.

    dump

    added in 1.0.0

    (dump)(dump registry)(dump filename registry)

    For the given filename (defaults to default-dump-filename) and a registry (defaults to a global registry) creates a dump in EDN format.

    -

    Filename will be placed in the default directory of resources (the same that which config.edn).

    export

    added in 1.0.0

    (export)(export registry)(export filename registry)

    For the given filename (defaults to default-dump-filename) and a registry (defaults to a global registry) creates a configuration file in EDN format.

    -

    Filename will be placed in the default directory of resources (the same which holds config.edn).

    handler-gen

    (handler-gen names)

    Generates handler functions for tagged literals for each namespaced currency. Each function will have a prefixed name.

    joda->bankster-dump

    added in 1.0.0

    (joda->bankster-dump)

    Reads Joda Money CSV files and creates a registry dump named resources/io/randomseed/bankster/registry-dump.edn.

    joda->bankster-export

    added in 1.0.0

    (joda->bankster-export)

    Reads Joda Money CSV files and creates a configuration file named resources/io/randomseed/bankster/registry-export.edn.

    joda-import

    added in 1.0.0

    (joda-import)(joda-import countries-pathname currencies-pathname)

    Reads CSV files with countries and currencies definitions (Joda Money format) and returns a registry.

    localized->map

    added in 1.0.0

    (localized->map m)

    Takes a localized map entry (1st level) and returns a map suitable for putting into a configuration file.

    readers-export

    added in 1.0.0

    (readers-export)(readers-export registry)(readers-export registry filenames)(readers-export registry filenames data-filename)(readers-export registry filenames data-filename handlers-pathname handlers-namespace)

    Creates clojure source code files with reader functions for tagged literals handling on a basis of registry information and data reader map files referring to the created handlers.

    +io.randomseed.bankster.util.importer documentation

    io.randomseed.bankster.util.importer

    countries-load

    added in 1.0.0

    (countries-load)(countries-load pathname)

    Reads CSV file in a format compliant with Joda Money and returns a map with currency to countries associations where countries are as sets. The pathname should be relative to resources directory.

    currencies-load

    added in 1.0.0

    (currencies-load)(currencies-load pathname)

    Reads CSV file compliant with Joda Money and returns a map with currency ID (keyword) as a key and currency data as its value (vector). The pathname should be relative to resources directory.

    currency->map

    added in 1.0.0

    (currency->map {:keys [:numeric :scale :kind :weight]})

    Takes a currency and returns a map suitable for putting into a configuration file. Extensions fields are ignored.

    default-countries-csv

    added in 1.0.0

    Default CSV file with countries database.

    default-currencies-csv

    added in 1.0.0

    Default CSV file with currencies database.

    default-data-reader-filename

    added in 1.2.4

    Default data reader filename (pure data).

    default-dump-filename

    added in 1.0.0

    Default EDN dump file.

    default-export-filename

    added in 1.0.0

    Default EDN export file.

    default-handlers-namespace

    added in 1.0.0

    Default namespace of a reader handlers.

    default-handlers-pathname

    added in 1.0.0

    Default pathname of a reader handlers file.

    default-reader-filenames

    added in 1.0.0

    Default data reader filenames (Clojure code).

    default-resource-must-exist-file

    added in 1.0.0

    Filename in a default resource container that must exist.

    default-resource-name

    added in 1.0.0

    Name of a default resource container.

    dump

    added in 1.0.0

    (dump)(dump registry)(dump filename registry)

    For the given filename (defaults to default-dump-filename) and a registry (defaults to a global registry) creates a dump in EDN format.

    +

    Filename will be placed in the default directory of resources (the same that which config.edn).

    export

    added in 1.0.0

    (export)(export registry)(export filename registry)

    For the given filename (defaults to default-dump-filename) and a registry (defaults to a global registry) creates a configuration file in EDN format.

    +

    Filename will be placed in the default directory of resources (the same which holds config.edn).

    handler-gen

    (handler-gen names)

    Generates handler functions for tagged literals for each namespaced currency. Each function will have a prefixed name.

    joda->bankster-dump

    added in 1.0.0

    (joda->bankster-dump)

    Reads Joda Money CSV files and creates a registry dump named resources/io/randomseed/bankster/registry-dump.edn.

    joda->bankster-export

    added in 1.0.0

    (joda->bankster-export)

    Reads Joda Money CSV files and creates a configuration file named resources/io/randomseed/bankster/registry-export.edn.

    joda-import

    added in 1.0.0

    (joda-import)(joda-import countries-pathname currencies-pathname)

    Reads CSV files with countries and currencies definitions (Joda Money format) and returns a registry.

    localized->map

    added in 1.0.0

    (localized->map m)

    Takes a localized map entry (1st level) and returns a map suitable for putting into a configuration file.

    readers-export

    added in 1.0.0

    (readers-export)(readers-export registry)(readers-export registry filenames)(readers-export registry filenames data-filename)(readers-export registry filenames data-filename handlers-pathname handlers-namespace)

    Creates clojure source code files with reader functions for tagged literals handling on a basis of registry information and data reader map files referring to the created handlers.

    The purpose of generation is primary to create handlers for literals in forms of

    #money/NS[…], where NS is a namespace that corresponds to a namespace of a currency. Possible namespaces are taken from a registry (a map from its field .cur-id->cur).

    The function takes a registry (defaults to a global registry if not given), a sequence of reader filenames (defaults to default-reader-filenames), default handlers pathname (defaults to default-handlers-pathname) and default handlers namespace (defaults to default-handlers-namespace).

    @@ -13,4 +13,4 @@
  • Append the file path passed as the handlers-pathname.

  • -

    As for data reader map files, their directory name is also based on the lookup of the first filename. Each filename will be populated with the same content which is a map associating tagged literal with a function.

    registry->map

    added in 1.0.0

    (registry->map)(registry->map registry)

    Takes a registry and returns a map suitable for putting into a configuration file. Extensions fields are ignored. When registry is not given it uses the global one. Extension fields are ignored.

    \ No newline at end of file +

    As for data reader map files, their directory name is also based on the lookup of the first filename. Each filename will be populated with the same content which is a map associating tagged literal with a function.

    registry->map

    added in 1.0.0

    (registry->map)(registry->map registry)

    Takes a registry and returns a map suitable for putting into a configuration file. Extensions fields are ignored. When registry is not given it uses the global one. Extension fields are ignored.

    \ No newline at end of file diff --git a/docs/io.randomseed.bankster.util.map.html b/docs/io.randomseed.bankster.util.map.html index f78e0f0..d3c60a4 100644 --- a/docs/io.randomseed.bankster.util.map.html +++ b/docs/io.randomseed.bankster.util.map.html @@ -1,3 +1,3 @@ -io.randomseed.bankster.util.map documentation

    io.randomseed.bankster.util.map

    assoc-if

    macro

    added in 1.0.0

    (assoc-if coll pred k val)

    assoc-if-key

    macro

    added in 1.0.0

    (assoc-if-key coll k pred val)

    assoc-if-not

    macro

    added in 1.0.0

    (assoc-if-not coll pred k val)

    assoc-if-not-key

    macro

    added in 1.0.0

    (assoc-if-not-key coll k pred val)

    dissoc-in

    added in 1.0.0

    (dissoc-in m [k & ks :as keys])

    Like assoc-in but removes entries. Leaves empty maps.

    invert-in-sets

    added in 1.0.0

    (invert-in-sets m)(invert-in-sets m dst)

    Like clojure.set/map-invert but preserves all possible values in sets.

    lazy-get

    macro

    added in 1.0.0

    (lazy-get m k exp)

    Like get but the default value is not evaluated if the key is found.

    map-keys

    added in 1.0.0

    (map-keys f m)(map-keys f m dst)

    For each key and value of the given map m calls a function passed as the first argument (passing successive keys during calls to it) and generates a map with keys updated by results returned by the function. When the third argument is given then it should be a map on which operations are performed instead of using an empty map.

    map-keys-and-vals

    added in 1.0.0

    (map-keys-and-vals f m)(map-keys-and-vals f m dst)

    For each key and value of the given map m calls a function passed as the first argument (passing successive keys during calls to it) and generates a map with keys updated by results returned by the function and values also updated by results of the same function. The function should return a sequential collection of 2 elements: first containing a new value of a key and second containing a new value of a transformed value associated with that key. When the third argument is given then it should be a map on which operations are performed instead of using an empty map.

    map-keys-by-v

    added in 1.0.0

    (map-keys-by-v f m)(map-keys-by-v f m dst)

    For each key and value of the given map m calls a function passed as the first argument (passing successive values during calls to it) and generates a map with keys updated by results returned by the function. When the third argument is given then it should be a map on which operations are performed instead of using and empty map.

    map-of-sets-invert

    added in 1.0.0

    (map-of-sets-invert m)

    Like clojure.set/map-invert but for map of sets (as values) to preserve all possible values (as keys of newly created map).

    map-of-vectors-invert-flatten

    added in 1.0.0

    (map-of-vectors-invert-flatten m)

    Like clojure.set/map-invert but for map of vectors (as values). Duplicated keys are replaced.

    map-vals

    added in 1.0.0

    (map-vals f m)(map-vals f m dst)

    For each key and value of the given map m calls a function passed as the first argument (passing successive values during calls to it) and generates a map with values updated by results returned by the function. When the third argument is given it should be a map on which operations are performed instead of using the original map. This may be helpful when we want to avoid merging the results with another map.

    map-vals-by-k

    added in 1.0.0

    (map-vals-by-k f m)(map-vals-by-k f m dst)

    For each key and value of the given map m calls a function passed as the first argument (passing successive keys during calls to it) and generates a map with values updated by results returned by the function. When the third argument is given it should be a map on which operations are performed instead of using the original map. This may be helpful when we want to avoid merging the results with another map.

    map-vals-by-kv

    added in 1.0.0

    (map-vals-by-kv f m)(map-vals-by-kv f m dst)

    For each key and value of the given map m calls a function passed as the first argument (passing successive keys and values during calls to it) and generates a map with values updated by results returned by the function. When the third argument is given it should be a map on which operations are performed instead of using the original map. This may be helpful when we want to avoid merging the results with another map.

    map-values

    added in 1.0.0

    (map-values f coll)

    Recursively transforms values of a coll using function f. The function should take a value and return new value.

    remove-by-if-value-in

    added in 1.0.0

    (remove-by-if-value-in m pred only)

    Removes map entries if the given predicate returns true and value is in the given set.

    remove-empty-values

    added in 1.0.0

    (remove-empty-values m)(remove-empty-values m only)

    Removes entries with empty values from a map.

    remove-except

    added in 1.0.0

    (remove-except m keyseq)

    remove-if-value

    added in 1.0.0

    (remove-if-value m pred)

    remove-if-value-in

    added in 1.0.0

    (remove-if-value-in m vals)

    remove-if-value-not-in

    added in 1.0.0

    (remove-if-value-not-in m vals)

    remove-keys-ns

    added in 1.0.2

    (remove-keys-ns m)

    Removes namespace component from qualified keys (keywords and symbols). Non-qualified identifiers and other data types are not renamed.

    update-existing

    added in 1.0.0

    (update-existing coll k fun & more)

    Updates the key k of the given collection coll by calling a function fun and passing optional arguments specified as additional arguments. Will not perform any update if the given key does not exist within the collection. Returns a collection.

    update-missing

    added in 1.0.0

    (update-missing coll k fun & more)

    update-values

    added in 1.0.0

    (update-values map vmap)(update-values map vmap create-keys?)

    Returns the given map with its values identified with keys from vmap updated with the associated functions from vmap.

    update-values-recur

    added in 1.0.0

    (update-values-recur map vmap)(update-values-recur map vmap create-keys?)

    Returns the given map with its values identified with keys from vmap recursively updated with the associated functions from vmap. Shape is not reflected, second map (vmap) should be flat, searching for keys is recursive, including nested vectors.

    \ No newline at end of file +io.randomseed.bankster.util.map documentation

    io.randomseed.bankster.util.map

    assoc-if

    macro

    added in 1.0.0

    (assoc-if coll pred k val)

    assoc-if-key

    macro

    added in 1.0.0

    (assoc-if-key coll k pred val)

    assoc-if-not

    macro

    added in 1.0.0

    (assoc-if-not coll pred k val)

    assoc-if-not-key

    macro

    added in 1.0.0

    (assoc-if-not-key coll k pred val)

    dissoc-in

    added in 1.0.0

    (dissoc-in m [k & ks :as keys])

    Like assoc-in but removes entries. Leaves empty maps.

    invert-in-sets

    added in 1.0.0

    (invert-in-sets m)(invert-in-sets m dst)

    Like clojure.set/map-invert but preserves all possible values in sets.

    lazy-get

    macro

    added in 1.0.0

    (lazy-get m k exp)

    Like get but the default value is not evaluated if the key is found.

    map-keys

    added in 1.0.0

    (map-keys f m)(map-keys f m dst)

    For each key and value of the given map m calls a function passed as the first argument (passing successive keys during calls to it) and generates a map with keys updated by results returned by the function. When the third argument is given then it should be a map on which operations are performed instead of using an empty map.

    map-keys-and-vals

    added in 1.0.0

    (map-keys-and-vals f m)(map-keys-and-vals f m dst)

    For each key and value of the given map m calls a function passed as the first argument (passing successive keys during calls to it) and generates a map with keys updated by results returned by the function and values also updated by results of the same function. The function should return a sequential collection of 2 elements: first containing a new value of a key and second containing a new value of a transformed value associated with that key. When the third argument is given then it should be a map on which operations are performed instead of using an empty map.

    map-keys-by-v

    added in 1.0.0

    (map-keys-by-v f m)(map-keys-by-v f m dst)

    For each key and value of the given map m calls a function passed as the first argument (passing successive values during calls to it) and generates a map with keys updated by results returned by the function. When the third argument is given then it should be a map on which operations are performed instead of using and empty map.

    map-of-sets-invert

    added in 1.0.0

    (map-of-sets-invert m)

    Like clojure.set/map-invert but for map of sets (as values) to preserve all possible values (as keys of newly created map).

    map-of-vectors-invert-flatten

    added in 1.0.0

    (map-of-vectors-invert-flatten m)

    Like clojure.set/map-invert but for map of vectors (as values). Duplicated keys are replaced.

    map-vals

    added in 1.0.0

    (map-vals f m)(map-vals f m dst)

    For each key and value of the given map m calls a function passed as the first argument (passing successive values during calls to it) and generates a map with values updated by results returned by the function. When the third argument is given it should be a map on which operations are performed instead of using the original map. This may be helpful when we want to avoid merging the results with another map.

    map-vals-by-k

    added in 1.0.0

    (map-vals-by-k f m)(map-vals-by-k f m dst)

    For each key and value of the given map m calls a function passed as the first argument (passing successive keys during calls to it) and generates a map with values updated by results returned by the function. When the third argument is given it should be a map on which operations are performed instead of using the original map. This may be helpful when we want to avoid merging the results with another map.

    map-vals-by-kv

    added in 1.0.0

    (map-vals-by-kv f m)(map-vals-by-kv f m dst)

    For each key and value of the given map m calls a function passed as the first argument (passing successive keys and values during calls to it) and generates a map with values updated by results returned by the function. When the third argument is given it should be a map on which operations are performed instead of using the original map. This may be helpful when we want to avoid merging the results with another map.

    map-values

    added in 1.0.0

    (map-values f coll)

    Recursively transforms values of a coll using function f. The function should take a value and return new value.

    remove-by-if-value-in

    added in 1.0.0

    (remove-by-if-value-in m pred only)

    Removes map entries if the given predicate returns true and value is in the given set.

    remove-empty-values

    added in 1.0.0

    (remove-empty-values m)(remove-empty-values m only)

    Removes entries with empty values from a map.

    remove-except

    added in 1.0.0

    (remove-except m keyseq)

    remove-if-value

    added in 1.0.0

    (remove-if-value m pred)

    remove-if-value-in

    added in 1.0.0

    (remove-if-value-in m vals)

    remove-if-value-not-in

    added in 1.0.0

    (remove-if-value-not-in m vals)

    remove-keys-ns

    added in 1.0.2

    (remove-keys-ns m)

    Removes namespace component from qualified keys (keywords and symbols). Non-qualified identifiers and other data types are not renamed.

    update-existing

    added in 1.0.0

    (update-existing coll k fun & more)

    Updates the key k of the given collection coll by calling a function fun and passing optional arguments specified as additional arguments. Will not perform any update if the given key does not exist within the collection. Returns a collection.

    update-missing

    added in 1.0.0

    (update-missing coll k fun & more)

    update-values

    added in 1.0.0

    (update-values map vmap)(update-values map vmap create-keys?)

    Returns the given map with its values identified with keys from vmap updated with the associated functions from vmap.

    update-values-recur

    added in 1.0.0

    (update-values-recur map vmap)(update-values-recur map vmap create-keys?)

    Returns the given map with its values identified with keys from vmap recursively updated with the associated functions from vmap. Shape is not reflected, second map (vmap) should be flat, searching for keys is recursive, including nested vectors.

    \ No newline at end of file diff --git a/pom.xml b/pom.xml index f3ad5db..9eb6638 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ io.randomseed bankster jar - 1.2.11 + 1.2.12 bankster Currencies and money processing in Clojure https://randomseed.io/software/bankster/ @@ -17,7 +17,7 @@ scm:git:git://github.com/randomseed-io/bankster.git scm:git:ssh://git@github.com/randomseed-io/bankster.git - 1.2.11 + 1.2.12 https://github.com/randomseed-io/bankster/ diff --git a/pom.xml.asc b/pom.xml.asc index 221d3b5..4c2c986 100644 --- a/pom.xml.asc +++ b/pom.xml.asc @@ -1,17 +1,17 @@ -----BEGIN PGP SIGNATURE----- Comment: GPGTools - http://gpgtools.org -iQIzBAABCAAdFiEElzhGBxSaMDOq9Z/XNjF6dNg249AFAmDtayYACgkQNjF6dNg2 -49B/lhAAxbBUy9HGb3kCsTtKJyrRX8rl6fL/FJUtNR/el/RHkStsIOsBgk3McgZP -WdHtcg84WiveJn03Cu6RD45qlOGgQ8xbh0zmfgWF8rp6h175relHczwKeoSGbc4f -YwYCklc8uCrXdGnfA6nTDtthPYAnNGctALGte9UTzK7pkOG/wJv1vVpWGcFErVhg -Md5LpY6O98DeQow95ge9WNUIxumhhEZE93XcDNNMBAEwE3MB0bH0U9jEEGg9AZEr -iqbjipOtN76ja9qLX5+LO5uVTg/XIF9MQuQ8Xio7wLPMszB52BEVq+pM5g5ZHN9c -ZummO2k/ySI+efHiBxCaHxhkMtFw8hYJW7UXCG1gKRbF0+IJOLJI3iUnZUP5ZyFc -oNGV6Iv3BNGP+NblWa/uIZQlenqTdVdJyzFxA1qUS2ixNUJQEb4+OZqQDQQnlTfo -l66p/KSMpfG4YYfK4pMNe3tVdOnbdYZmgL5Hh+VUloTsNOBYYjW0YaRkkF6TjMej -1s+Mwmhyql5yC7529guiBNouW/9DAooyqiZFPB5UgGsnQD3MLTwJ9Zs8qKhLJ0l0 -iwjLr9R/556OtauNffwTk8wF9zUDhqDz8I7MpHHYxIM7nK/yUIuJpc4pKMZGvKOM -p4v2CTIjDk9NoOg9hHzLfOqy6Ed11QAIVovy5k5VHkA5nCI9dMY= -=96A/ +iQIzBAABCAAdFiEElzhGBxSaMDOq9Z/XNjF6dNg249AFAmD0YdQACgkQNjF6dNg2 +49DpeBAAz2kmraRnsNM/lvl580wvRyG2Uf0AD03Rxeg+JIYEBuix4+bDOi7fefTq +OD1w0wAtyM/gff3eSBmuGM17mSu8Kpa8IPtKTqdZDX5yEv87hNaY67HhXEIcLMiB +hXSekxMH8NMH+OWOL+lHuYLmAhvYHSrdEagh2poYqAhR9ZxMoUPS/pv6BRt414Ih +99I/+WX9xmdoLP6qSpC3eyyFcazQcE3Y11IAf4MkjKyj08jHii+zCtxr2EXBJq7r +X8Pv/EbQeOv/dqusESXAy70UGqKn4itbpwKJPsLvXUfnVBiW71WnRUSxSWnERuLo +q0tg0olRhW+0MJYrw2ekUadHSP79M2DfeANY8mbqzba0ans3HyPLXL/oX7sOGhaC +ed6IP5kPVikxRFE2QbiZ3SILo9dGaHAG4Y5uHmhtJn/ZA/vhgoa+FSjL3rPI65DC +rXVRm+H33+k6TQ/a5Sr9sX/vGW+mKqm2IiNIdus6yaVqqATMZPFBUdZyoBO6frmq +YnQgzi2lafnmxcRFjVVQVXRYGBGZC9WajUFci3JSCrxmi2hThRSts9CJ2YREDut1 +/WNLRFSj7wU4fb5TE2JQx94Z8t0+ZcdoW+6SqgX2kakECP0tqmFocj2yUZ/E8tCD +z2TkmVW9JV/UT0wdTERccNHM3AUvKQmT5Zn2UYLEdX477lTcZrE= +=J69l -----END PGP SIGNATURE-----