Liking cljdoc? Tell your friends :D

com.fulcrologic.rad.type-support.decimal

Support for CLJC arbitrary precision decimal numerics. CLJ support for BigDecimal works well, but it is not directly supported in CLJS. Use the support in this ns when you need to write CLJC code that works the same in both.

You MUST include big.js as a js dependency for this to compile in CLJS.

Support for CLJC arbitrary precision decimal numerics. CLJ support for BigDecimal works well, but it is not
directly supported in CLJS.  Use the support in this ns when you need to write CLJC code that works the same
in both.

You MUST include big.js as a js dependency for this to compile in CLJS.
raw docstring

*clj/s

(*)
(* & numbers)

Multiply the given numbers, using bigdecimal math

Multiply the given numbers, using bigdecimal math
sourceraw docstring

*precision*clj/s

source

*primitive*clj/s

source

+clj/s

(+)
(+ & numbers)

Add the given numbers together, coercing any that are not numeric.

Add the given numbers together, coercing any that are not numeric.
sourceraw docstring

-clj/s

(- & numbers)

Subtract the given numbers, using bigdecimal math

Subtract the given numbers, using bigdecimal math
sourceraw docstring

<clj/s

source

<=clj/s

source

=clj/s

source

>clj/s

source

>=clj/s

source

bigdecimalclj/s

source

bigdecimal?clj/s

(bigdecimal? v)
source

compare-fnclj/s≠

clj
(compare-fn core-fn)
cljs
(compare-fn big-fn)
source

divclj/s

(div n d)
(div n d precision)

Divide the given two numbers, using bigdecimal math, with 20 digits of precision. In primitive mode just uses regular /.

Divide the given two numbers, using bigdecimal math, with 20 digits
of precision. In primitive mode just uses regular `/`.
sourceraw docstring

floorclj/s

(floor n)

Returns the floor of n, which is n with all decimal digits removed.

Returns the floor of n, which is n with all decimal digits removed.
sourceraw docstring

maxclj/s

(max number & numbers)
source

minclj/s

(min number & numbers)
source

negativeclj/s

(negative n)

If n is positive then returns n*(-1) else returns n.

If n is positive then returns n*(-1) else returns n.
sourceraw docstring

negative?clj/s

(negative? v)

Predicate for clj(s) negative bigdecimal

Predicate for clj(s) negative bigdecimal
sourceraw docstring

numericclj/s

(numeric s)

Coerce to a numeric from an arbitrary type (number, string, or numeric).

Coerce to a numeric from an arbitrary type (number, string, or numeric).
sourceraw docstring

numeric->currency-strclj/s

(numeric->currency-str n)
(numeric->currency-str n language country currency-code)

Convert a numeric into a locale-specific currency string. The defaults are en, US, and USD.

Convert a numeric into a locale-specific currency string. The defaults are `en`, `US`, and `USD`.
sourceraw docstring

numeric->doubleclj/s

(numeric->double n)
source

numeric->percent-strclj/s

(numeric->percent-str n)
source

numeric->strclj/s

(numeric->str bd)

Convert a math number to a string.

Convert a math number to a string.
sourceraw docstring

numeric?clj/s

(numeric? v)

Predicate for clj(s) dynamic number (n or bigdecimal). Returns true if the given value is a numeric in the current computing context (primitive or BigDecimal).

Predicate for clj(s) dynamic number (n or bigdecimal). Returns true if the given value is a numeric
in the current computing context (primitive or BigDecimal).
sourceraw docstring

positiveclj/s

(positive n)

If n is negative then returns n*(-1) else returns n.

If n is negative then returns n*(-1) else returns n.
sourceraw docstring

positive?clj/s

(positive? v)

Predicate for clj(s) positive bigdecimal

Predicate for clj(s) positive bigdecimal
sourceraw docstring

roundclj/s

(round n decimal-digits)

Round the given number to the given number of decimal digits. Returns a new bigdecimal number.

n can be nil (returns 0), a numeric string, a regular number, or a bigdecimal.

Round the given number to the given number of
decimal digits. Returns a new bigdecimal number.

n can be nil (returns 0), a numeric string, a regular number, or a bigdecimal.
sourceraw docstring

strip-zeroesclj/s

(strip-zeroes s)
source

with-primitive-opsclj/smacro

(with-primitive-ops & body)

Creates a thread-safe dynamic context where the math operations from this namespace use primitives instead of BigDecimal for speed.

Creates a thread-safe dynamic context where the math operations from this namespace
use primitives instead of BigDecimal for speed.
sourceraw docstring

zeroclj/s

(zero)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close