(divide money & divisors)
Divides the given money structure by the divisors
Divides the given money structure by the divisors
(eq & moneys)
Returns true if all money structures are equal
Returns true if all money structures are equal
(format amount)
(format {:keys [cents currency] :as amount} options)
Returns the formatted amount and currency E.g. (format {:cents 432199, :currency "EUR"}) # => "4,321.99 EUR" :display-cents false - hide the cents ("4,321 EUR" in the example above) - true per default
Returns the formatted amount and currency E.g. (format {:cents 432199, :currency "EUR"}) # => "4,321.99 EUR" :display-cents false - hide the cents ("4,321 EUR" in the example above) - true per default
(format-amount {:keys [cents currency]} {:keys [display-cents group-separator]})
Returns the formatted amount of the given money structure E.g. (format-amount {:cents 432199, :currency "EUR"}) # => "4,321" :display-cents true - print cents ("4,321.99" in the example above") - false per default :group-separator - use the given separator instead of the comma
Returns the formatted amount of the given money structure E.g. (format-amount {:cents 432199, :currency "EUR"}) # => "4,321" :display-cents true - print cents ("4,321.99" in the example above") - false per default :group-separator - use the given separator instead of the comma
(ge & moneys)
Returns true if the given money structures are >=
Returns true if the given money structures are >=
(gt & moneys)
Returns true if the given money structures are >
Returns true if the given money structures are >
(le & moneys)
Returns true if the given money structures are <=
Returns true if the given money structures are <=
(lt & moneys)
Returns true if the given money structures are <
Returns true if the given money structures are <
(maximum)
(maximum & moneys)
Returns the biggest of the given money structure
Returns the biggest of the given money structure
(minimum)
(minimum & moneys)
Returns the smallest of the given money structures
Returns the smallest of the given money structures
(minus & moneys)
Substracts the given money structures from the first
Substracts the given money structures from the first
(multiply money & multipliers)
Multipies the given money structure by the multipliers
Multipies the given money structure by the multipliers
(negative? money)
Returns true if the given money structure is negative
Returns true if the given money structure is negative
(not-eq & moneys)
Returns true if the given money structures are not equal
Returns true if the given money structures are not equal
(percent-ratio a b)
Returns the ratio between the given money structures as a percent value E.g. (percent-ratio {:cents 218, :currency "EUR"} {:cents 1000, :currency "EUR"}) # => {:cents 109/5, :currency "EUR"}
Returns the ratio between the given money structures as a percent value E.g. (percent-ratio {:cents 218, :currency "EUR"} {:cents 1000, :currency "EUR"}) # => {:cents 109/5, :currency "EUR"}
(plus & moneys)
Sums up all given money structures
Sums up all given money structures
(positive? money)
Returns true if the given money structure is positive
Returns true if the given money structure is positive
(round-down-to-multiple-of round-to money)
Rounds the second money structure to a multiple of the first E.g. (round-down-to-multiple-of {:cents 10000, :currency "EUR"} {:cents 39912, currency "EUR"}) # => {:cents 30000, :currency "EUR"}
Rounds the second money structure to a multiple of the first E.g. (round-down-to-multiple-of {:cents 10000, :currency "EUR"} {:cents 39912, currency "EUR"}) # => {:cents 30000, :currency "EUR"}
(with-amount->with-cents {:keys [:amount :currency]} & [{:keys [:multiplier]}])
(zero? money)
Returns true if the given money structure is zero
Returns true if the given money structure is zero
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close