(boxed f x)Transform the quantity's number by any fn (i.e. fmap on the quantity-functor). Also works for numbers.
Transform the quantity's number by any fn (i.e. fmap on the quantity-functor). Also works for numbers.
(compatible-units quantity)Returns units with the same measure as quantity.
Returns units with the same measure as quantity.
(composition q)The composition of this quantity.
The composition of this quantity.
(defunit unit-fn-name measure symb scale-or-comp)(defunit unit-fn-name measure symb scaling composition)Can be used to define units, but it's not compatible with cljs. Alternatively use the form this expands to: (def unit-fn-name (new-unit measure symbol scaling composition))
Can be used to define units, but it's not compatible with cljs. Alternatively use the form this expands to: (def unit-fn-name (new-unit measure symbol scaling composition))
(defunit-once unit-fn-name measure symb scale-or-comp)(defunit-once unit-fn-name measure symb scaling composition)Can be used to define units, but it's not compatible with cljs. Alternatively use the form this expands to: (defonce unit-fn-name (new-unit measure symbol scaling composition))
Can be used to define units, but it's not compatible with cljs. Alternatively use the form this expands to: (defonce unit-fn-name (new-unit measure symbol scaling composition))
(measure q)What this quantity is a measure of.
What this quantity is a measure of.
(new-unit measure symb scale-or-comp)(new-unit measure symb scaling composition)Register a new type of unit with the given measure, symbol, composition and/or scaling. Returns a fn (fn [number]) that creates a quantity of this unit.
Register a new type of unit with the given measure, symbol, composition and/or scaling. Returns a fn (fn [number]) that creates a quantity of this unit.
(num q)Get the number from a quantity. Pass through if already a number.
Get the number from a quantity. Pass through if already a number.
(quantity unit x)Makes a new quantity of unit and x.
Makes a new quantity of unit and x. - unit must be a quantity (but the number part is ignored). - x must be number-ish, i.e. a number, string of number, or another quantity. If x is a quantity, it will be converted (or throw exception if incompatible).
(symbol q)The unit symbol for this quantity.
The unit symbol for this quantity.
(with-num quantity n)Make copy of a quantity with a different number.
Make copy of a quantity with a different number.
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 |