convert_conc — convert a quantity from one given unit to another.
NUMERIC
convert_conc
(
|
quantity, | |
| from_unit, | ||
to_unit); |
NUMERIC
quantity
;
TEXT
from_unit
;
TEXT
to_unit
;The concentration in need of conversion, e.g. a NUCACID_CONC_DATA.Quantity value. A NUMERIC value, or any other data type that can be interpreted as a number and converted to NUMERIC.
A text string indicating the unit to convert from. In other words, the current unit of the quantity. This must be a NUCACID_CONC_UNITS.Unit value.
A text string indicating the unit to convert into. In other words, the desired unit of the quantity. This must be a NUCACID_CONC_UNITS.Unit value.
Returns a number, the converted concentration. If
the two units are not related — their respective
NUCACID_CONC_UNITS.Reference values are not
equal — then no conversion can occur and this
function returns NULL.
This function is used by the NUCACIDS_W_CONC view to generate its several concentration columns. It may also be useful to users trying to standardize concentrations when querying NUCACID_CONC_DATA.