-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't convert Celsius to K #5
Comments
This is a missing feature: the only conversions ucum.js handles are units
|
For reference, here's all the function-defined units: <unit xmlns="" Code="Cel" CODE="CEL" isMetric="yes" isSpecial="yes" class="si">
<name>degree Celsius</name>
<printSymbol>°C</printSymbol>
<property>temperature</property>
<value Unit="cel(1 K)" UNIT="CEL(1 K)">
<function name="Cel" value="1" Unit="K"/>
</value>
</unit>
<unit xmlns="" Code="[degF]" CODE="[DEGF]" isMetric="no" isSpecial="yes" class="heat">
<name>degree Fahrenheit</name>
<printSymbol>°F</printSymbol>
<property>temperature</property>
<value Unit="degf(5 K/9)" UNIT="DEGF(5 K/9)">
<function name="degF" value="5" Unit="K/9"/>
</value>
</unit>
<unit xmlns="" Code="[p'diop]" CODE="[P'DIOP]" isMetric="no" isSpecial="yes"
class="clinical">
<name>prism diopter</name>
<printSymbol>PD</printSymbol>
<property>refraction of a prism</property>
<value Unit="100tan(1 rad)" UNIT="100TAN(1 RAD)">
<function name="tanTimes100" value="1" Unit="deg"/>
</value>
</unit>
<unit xmlns="" Code="%[slope]" CODE="%[SLOPE]" isMetric="no" isSpecial="yes"
class="clinical">
<name>percent of slope</name>
<printSymbol>%</printSymbol>
<property>slope</property>
<value Unit="100tan(1 rad)" UNIT="100TAN(1 RAD)">
<function name="100tan" value="1" Unit="deg"/>
</value>
</unit> The two last units above are interesting as it seems that their function names are inconsistent ( EDIT: Just opened a ticket for that on UCUM's trac. Remaining units: <unit xmlns="" Code="[hp'_X]" CODE="[HP'_X]" isMetric="no" isSpecial="yes"
class="clinical">
<name>homeopathic potency of decimal series (retired)</name>
<printSymbol>X</printSymbol>
<property>homeopathic potency (retired)</property>
<value Unit="hpX(1 1)" UNIT="HPX(1 1)">
<function name="hpX" value="1" Unit="1"/>
</value>
</unit>
<unit xmlns="" Code="[hp'_C]" CODE="[HP'_C]" isMetric="no" isSpecial="yes"
class="clinical">
<name>homeopathic potency of centesimal series (retired)</name>
<printSymbol>C</printSymbol>
<property>homeopathic potency (retired)</property>
<value Unit="hpC(1 1)" UNIT="HPC(1 1)">
<function name="hpC" value="1" Unit="1"/>
</value>
</unit>
<unit xmlns="" Code="[hp'_M]" CODE="[HP'_M]" isMetric="no" isSpecial="yes"
class="clinical">
<name>homeopathic potency of millesimal series (retired)</name>
<printSymbol>M</printSymbol>
<property>homeopathic potency (retired)</property>
<value Unit="hpM(1 1)" UNIT="HPM(1 1)">
<function name="hpM" value="1" Unit="1"/>
</value>
</unit>
<unit xmlns="" Code="[hp'_Q]" CODE="[HP'_Q]" isMetric="no" isSpecial="yes"
class="clinical">
<name>homeopathic potency of quintamillesimal series (retired)</name>
<printSymbol>Q</printSymbol>
<property>homeopathic potency (retired)</property>
<value Unit="hpQ(1 1)" UNIT="HPQ(1 1)">
<function name="hpQ" value="1" Unit="1"/>
</value>
</unit>
<unit xmlns="" Code="[pH]" CODE="[PH]" isMetric="no" isSpecial="yes" class="chemical">
<name>pH</name>
<printSymbol>pH</printSymbol>
<property>acidity</property>
<value Unit="pH(1 mol/l)" UNIT="PH(1 MOL/L)">
<function name="pH" value="1" Unit="mol/l"/>
</value>
</unit>
<unit xmlns="" Code="Np" CODE="NEP" isMetric="yes" isSpecial="yes" class="levels">
<name>neper</name>
<printSymbol>Np</printSymbol>
<property>level</property>
<value Unit="ln(1 1)" UNIT="LN(1 1)">
<function name="ln" value="1" Unit="1"/>
</value>
</unit>
<unit xmlns="" Code="B" CODE="B" isMetric="yes" isSpecial="yes" class="levels">
<name>bel</name>
<printSymbol>B</printSymbol>
<property>level</property>
<value Unit="lg(1 1)" UNIT="LG(1 1)">
<function name="lg" value="1" Unit="1"/>
</value>
</unit>
<unit xmlns="" Code="B[SPL]" CODE="B[SPL]" isMetric="yes" isSpecial="yes"
class="levels">
<name>bel sound pressure</name>
<printSymbol>B(SPL)</printSymbol>
<property>pressure level</property>
<value Unit="2lg(2 10*-5.Pa)" UNIT="2LG(2 10*-5.PAL)">
<function name="lgTimes2" value="2" Unit="10*-5.Pa"/>
</value>
</unit>
<unit xmlns="" Code="B[V]" CODE="B[V]" isMetric="yes" isSpecial="yes" class="levels">
<name>bel volt</name>
<printSymbol>B(V)</printSymbol>
<property>electric potential level</property>
<value Unit="2lg(1 V)" UNIT="2LG(1 V)">
<function name="lgTimes2" value="1" Unit="V"/>
</value>
</unit>
<unit xmlns="" Code="B[mV]" CODE="B[MV]" isMetric="yes" isSpecial="yes" class="levels">
<name>bel millivolt</name>
<printSymbol>B(mV)</printSymbol>
<property>electric potential level</property>
<value Unit="2lg(1 mV)" UNIT="2LG(1 MV)">
<function name="lgTimes2" value="1" Unit="mV"/>
</value>
</unit>
<unit xmlns="" Code="B[uV]" CODE="B[UV]" isMetric="yes" isSpecial="yes" class="levels">
<name>bel microvolt</name>
<printSymbol>B(μV)</printSymbol>
<property>electric potential level</property>
<value Unit="2lg(1 uV)" UNIT="2LG(1 UV)">
<function name="lgTimes2" value="1" Unit="uV"/>
</value>
</unit>
<unit xmlns="" Code="B[10.nV]" CODE="B[10.NV]" isMetric="yes" isSpecial="yes"
class="levels">
<name>bel 10 nanovolt</name>
<printSymbol>B(10 nV)</printSymbol>
<property>electric potential level</property>
<value Unit="2lg(10 nV)" UNIT="2LG(10 NV)">
<function name="lgTimes2" value="10" Unit="nV"/>
</value>
</unit>
<unit xmlns="" Code="B[W]" CODE="B[W]" isMetric="yes" isSpecial="yes" class="levels">
<name>bel watt</name>
<printSymbol>B(W)</printSymbol>
<property>power level</property>
<value Unit="lg(1 W)" UNIT="LG(1 W)">
<function name="lg" value="1" Unit="W"/>
</value>
</unit>
<unit xmlns="" Code="B[kW]" CODE="B[KW]" isMetric="yes" isSpecial="yes" class="levels">
<name>bel kilowatt</name>
<printSymbol>B(kW)</printSymbol>
<property>power level</property>
<value Unit="lg(1 kW)" UNIT="LG(1 KW)">
<function name="lg" value="1" Unit="kW"/>
</value>
</unit>
<unit xmlns="" Code="bit_s" CODE="BIT_S" isMetric="no" isSpecial="yes"
class="infotech">
<name>bit</name>
<printSymbol>bit<sub>s</sub>
</printSymbol>
<property>amount of information</property>
<value Unit="ld(1 1)" UNIT="ld(1 1)">
<function name="ld" value="1" Unit="1"/>
</value>
</unit> In the latest UCUM release, there's also the following function-defined unit: <unit Code="[m/s2/Hz^(1/2)]" CODE="[M/S2/HZ^(1/2)]" isMetric="no" isSpecial="yes"
class="misc">
<name>meter per square seconds per square root of hertz</name>
<printSymbol/>
<property>amplitude spectral density</property>
<value Unit="sqrt(1 m2/s4/Hz)" UNIT="SQRT(1 M2/S4/HZ)">
<function name="sqrt" value="1" Unit="m2/s4/Hz"/>
</value>
</unit> |
... |
ucum.convert(20, 'Cel', 'K')
throws a long syntax error. Shouldn't that work?The text was updated successfully, but these errors were encountered: