scribe.decimal
Utils for the conversions and massaging of BigDecimal values.
byte-buffer?
(byte-buffer? x)
Is `x` an instance of a `java.nio.ByteBuffer` or any of its subclasses?
bytes->decimal
(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`.
decimal->bytes
(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.
decimal->fixed
(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
fixed->decimal
(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
set-precision
(set-precision bd precision)
Sets the `precision` of a `BigDecimal` `bd`.
set-scale
(set-scale bd scale)
Sets the `scale` of a `BigDecimal` `bd`.