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).
(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.
(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.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |