Liking cljdoc? Tell your friends :D

schemallic.transforms.numeric

Numeric constraint props to Malli schema helpers.

Provides digit-count and decimal-places-count for counting significant digits in a number, ignoring sign, exponent, decimal point, BigDecimal suffix, and leading/trailing zeros (pydantic max_digits semantics).

Numeric constraint props to Malli schema helpers.

Provides digit-count and decimal-places-count for counting significant
digits in a number, ignoring sign, exponent, decimal point, BigDecimal
suffix, and leading/trailing zeros (pydantic max_digits semantics).
raw docstring

decimals->countclj

(decimals->count x)

Inputs: [x :- s/Num] Returns: s/Int

Count significant digits after the decimal point in a number, ignoring sign, exponent and trailing fractional zeros: 1.5 -> 1, 0.0005 -> 4, 100 -> 0, -12.345 -> 3, 1.5E10 -> 0.

Inputs: [x :- s/Num]
Returns: s/Int

Count significant digits after the decimal point in a number, ignoring
 sign, exponent and trailing fractional zeros: 1.5 -> 1, 0.0005 -> 4,
 100 -> 0, -12.345 -> 3, 1.5E10 -> 0.
sourceraw docstring

digits->countclj

(digits->count x)

Inputs: [x :- s/Num] Returns: s/Int

Count significant digits in a number, ignoring sign, exponent, decimal point, BigDecimal suffix, and leading/trailing zeros (pydantic max_digits semantics): 100 -> 1, 0.001 -> 1, 1.50 -> 2, -12.34 -> 4.

Inputs: [x :- s/Num]
Returns: s/Int

Count significant digits in a number, ignoring sign, exponent, decimal
 point, BigDecimal suffix, and leading/trailing zeros (pydantic max_digits
 semantics): 100 -> 1, 0.001 -> 1, 1.50 -> 2, -12.34 -> 4.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close