Liking cljdoc? Tell your friends :D

scribe.decimal

Utils for the conversions and massaging of BigDecimal values.

Utils for the conversions and massaging of BigDecimal values.
raw docstring

->decimal-conformercljmacro

(->decimal-conformer & {:keys [precision scale]})

Returns a clojure.spec.alpha/conformer, that conforms a decimal? with precision and scale, returning :clojure.spec.alpha/invalid if unsuccessful.

Returns a `clojure.spec.alpha/conformer`, that conforms a `decimal?` with
`precision` and `scale`, returning `:clojure.spec.alpha/invalid` if
unsuccessful.
raw docstring

byte-buffer?clj

(byte-buffer? x)

Is x an instance of a java.nio.ByteBuffer or any of its subclasses?

Is `x` an instance of a `java.nio.ByteBuffer` or any of its subclasses?
raw docstring

bytes->decimalclj

(bytes->decimal buffer-or-bytes precision scale)

Converts a byte array or ByteBuffer containing the two's-complement representation of an unscaled Integer value in big-endian byte order to a BigDecimal.

Converts a byte array or `ByteBuffer` containing the two's-complement
representation of an unscaled Integer value in big-endian byte
order to a `BigDecimal`.
raw docstring

decimal->bytesclj

(decimal->bytes bd precision scale)

Converts a BigDecimal bd to a ByteBuffer containing the two's-complement representation of its underlying unscaled BigInteger value in big-endian byte order.

Converts a `BigDecimal` `bd` to a `ByteBuffer` containing the
two's-complement representation of its underlying unscaled `BigInteger` value
in big-endian byte order.
raw docstring

decimal->fixedclj

(decimal->fixed bd precision scale)

Converts a BigDecimal to a org.apache.avro.generic.GenericFixed containing the two's-complement representation of its underlying unscaled BigInteger value in big-endian byte order.

TODO FIXME not implemented

Converts a `BigDecimal` to a `org.apache.avro.generic.GenericFixed`
containing the two's-complement representation of its underlying unscaled
BigInteger value in big-endian byte order.

TODO FIXME not implemented
raw docstring

fixed->decimalclj

(fixed->decimal fixed precision scale)

Converts an org.apache.avro.generic.GenericFixed containing the two's-complement representation of an unscaled Integer value in big-endian byte order to a BigDecimal.

TODO FIXME not really implemented

Converts an `org.apache.avro.generic.GenericFixed` containing the
two's-complement representation of an unscaled Integer value in big-endian
byte order to a `BigDecimal`.

TODO FIXME not really implemented
raw docstring

s-conform-decimalclj

(s-conform-decimal precision scale bd)

Conforms the decimal? bd with precision and scale, returning :clojure.spec.alpha/invalid if unsuccessful.

This is the f in the call to clojure.spec.alpha/conformer.

NOTE you probably don't want to call this, use ->decimal-conformer instead.

Conforms the `decimal?` `bd` with `precision` and `scale`, returning
`:clojure.spec.alpha/invalid` if unsuccessful.

This is the `f` in the call to `clojure.spec.alpha/conformer`.

NOTE you probably don't want to call this, use `->decimal-conformer` instead.
raw docstring

set-precisionclj

(set-precision bd precision)

Sets the precision of a BigDecimal bd.

Sets the `precision` of a `BigDecimal` `bd`.
raw docstring

set-scaleclj

(set-scale bd scale)

Sets the scale of a BigDecimal bd.

Sets the `scale` of a `BigDecimal` `bd`.
raw docstring

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

× close