模板:Chem molar mass:修订间差异

来自Hyacinth
跳转到导航 跳转到搜索
删除的内容 添加的内容
草awa留言 | 贡献
Created page with "{{#iferror:{{{value|}}}|{{#if:{{{fixed|}}}|{{{fixed|}}}|<sup class="noprint Inline-Template" style="white-space:nowrap;">[<i><span title="Cannot calculate molar mass from chemical formula (atom counts not all numeric)">cannot calculate</span></i>]</sup>}}{{main other|Category:Articles with erroneous molar mass calculations}}| {{yesno |{{{sortable|no}}}<!-- -->|no=<!-- -->{{#ifexpr:{{#e..."
 
草awa留言 | 贡献
无编辑摘要
第1行: 第1行:
{{Chem molar mass/format
{{#iferror:{{{value|}}}|{{#if:{{{fixed|}}}|{{{fixed|}}}|<sup class="noprint Inline-Template" style="white-space:nowrap;">&#91;<i>[[Wikipedia:WikiProject Chemicals/Molar mass#Cannot calculate molar mass|<span title="Cannot calculate molar mass from chemical formula (atom counts not all numeric)">cannot calculate</span>]]</i>&#93;</sup>}}{{main other|[[Category:Articles with erroneous molar mass calculations]]}}|
|value={{#expr:
{{yesno |{{{sortable|no}}}<!--
(0) +
-->|no=<!--
(0{{{H|0}}} * 1.008) +
-->{{#ifexpr:{{#expr:{{formatnum:{{{value|0}}}|R}}}}>0
(0{{{D|0}}} * 2.013553212745) +
|{{#if:{{{fixed|}}} |{{{fixed|}}}<!--
(0{{{Li|0}}} * 6.94) +
and categorize for maintenance because two values are entered:
(0{{{B|0}}} * 10.81) +
-->{{main other|{{#if:{{{catname|}}}<!--
(0{{{C|0}}} * 12.011) +
-->|[[{{#invoke:String|replace|source=Category:{{{catname|}}}<!--
(0{{{N|0}}} * 14.007) +
-->|pattern=^Category%:[Cc]ategory%:|replace=Category:|plain=false}}]]}}}}<!--
(0{{{O|0}}} * 15.999) +

(0{{{Mg|0}}} * 24.305) +
-->|{{#ifeq:{{{round|x}}}|no
|{{{value|0}}}
(0{{{Si|0}}} * 28.085) +
(0{{{S|0}}} * 32.06) +
|{{#invoke:math|precision_format |{{{value|0}}} |{{{round|2}}} }}}}<!--
(0{{{Cl|0}}} * 35.45) +
-->&nbsp;{{#if:{{{unit|}}} |{{{unit|}}} |g·mol<sup>−1</sup>}}
(0{{{Br|0}}} * 79.904) +
(0{{{Tl|0}}} * 204.38) +
(0{{{He|0}}} * 4.002602) +
(0{{{Be|0}}} * 9.0121831) +
(0{{{F|0}}} * 18.998403163) +
(0{{{Ne|0}}} * 20.1797) +
(0{{{Na|0}}} * 22.98976928) +
(0{{{Al|0}}} * 26.9815384) +
(0{{{P|0}}} * 30.973761998) +
(0{{{K|0}}} * 39.0983) +
(0{{{Ar|0}}} * 39.948) +
(0{{{Ca|0}}} * 40.078) +
(0{{{Sc|0}}} * 44.955908) +
(0{{{Ti|0}}} * 47.867) +
(0{{{V|0}}} * 50.9415) +
(0{{{Cr|0}}} * 51.9961) +
(0{{{Mn|0}}} * 54.938043) +
(0{{{Fe|0}}} * 55.845) +
(0{{{Ni|0}}} * 58.6934) +
(0{{{Co|0}}} * 58.933194) +
(0{{{Cu|0}}} * 63.546) +
(0{{{Zn|0}}} * 65.38) +
(0{{{Ga|0}}} * 69.723) +
(0{{{Ge|0}}} * 72.630) +
(0{{{As|0}}} * 74.921595) +
(0{{{Se|0}}} * 78.971) +
(0{{{Kr|0}}} * 83.798) +
(0{{{Rb|0}}} * 85.4678) +
(0{{{Sr|0}}} * 87.62) +
(0{{{Y|0}}} * 88.90584) +
(0{{{Zr|0}}} * 91.224) +
(0{{{Nb|0}}} * 92.90637) +
(0{{{Mo|0}}} * 95.95) +
(0{{{Ru|0}}} * 101.07) +
(0{{{Rh|0}}} * 102.90549) +
(0{{{Pd|0}}} * 106.42) +
(0{{{Ag|0}}} * 107.8682) +
(0{{{Cd|0}}} * 112.414) +
(0{{{In|0}}} * 114.818) +
(0{{{Sn|0}}} * 118.710) +
(0{{{Sb|0}}} * 121.760) +
(0{{{I|0}}} * 126.90447) +
(0{{{Te|0}}} * 127.60) +
(0{{{Xe|0}}} * 131.293) +
(0{{{Cs|0}}} * 132.90545196) +
(0{{{Ba|0}}} * 137.327) +
(0{{{La|0}}} * 138.90547) +
(0{{{Ce|0}}} * 140.116) +
(0{{{Pr|0}}} * 140.90766) +
(0{{{Nd|0}}} * 144.242) +
(0{{{Sm|0}}} * 150.36) +
(0{{{Eu|0}}} * 151.964) +
(0{{{Gd|0}}} * 157.25) +
(0{{{Tb|0}}} * 158.925354) +
(0{{{Dy|0}}} * 162.500) +
(0{{{Ho|0}}} * 164.930328) +
(0{{{Er|0}}} * 167.259) +
(0{{{Tm|0}}} * 168.934218) +
(0{{{Yb|0}}} * 173.045) +
(0{{{Lu|0}}} * 174.9668) +
(0{{{Hf|0}}} * 178.49) +
(0{{{Ta|0}}} * 180.94788) +
(0{{{W|0}}} * 183.84) +
(0{{{Re|0}}} * 186.207) +
(0{{{Os|0}}} * 190.23) +
(0{{{Ir|0}}} * 192.217) +
(0{{{Pt|0}}} * 195.084) +
(0{{{Au|0}}} * 196.966570) +
(0{{{Hg|0}}} * 200.592) +
(0{{{Pb|0}}} * 207.2) +
(0{{{Bi|0}}} * 208.98040) +
(0{{{Pa|0}}} * 231.03588) +
(0{{{Th|0}}} * 232.0377) +
(0{{{U|0}}} * 238.02891) +
(0{{{Tc|0}}} * 98) +
(0{{{Pm|0}}} * 145) +
(0{{{Po|0}}} * 209) +
(0{{{At|0}}} * 210) +
(0{{{Rn|0}}} * 222) +
(0{{{Fr|0}}} * 223) +
(0{{{Ra|0}}} * 226) +
(0{{{Ac|0}}} * 227) +
(0{{{Np|0}}} * 237) +
(0{{{Pu|0}}} * 244) +
(0{{{Am|0}}} * 243) +
(0{{{Cm|0}}} * 247) +
(0{{{Bk|0}}} * 247) +
(0{{{Cf|0}}} * 251) +
(0{{{Es|0}}} * 252) +
(0{{{Fm|0}}} * 257) +
(0{{{Md|0}}} * 258) +
(0{{{No|0}}} * 259) +
(0{{{Lr|0}}} * 266) +
(0{{{Rf|0}}} * 267) +
(0{{{Db|0}}} * 268) +
(0{{{Sg|0}}} * 269) +
(0{{{Bh|0}}} * 270) +
(0{{{Hs|0}}} * 270) +
(0{{{Mt|0}}} * 278) +
(0{{{Ds|0}}} * 281) +
(0{{{Rg|0}}} * 282) +
(0{{{Cn|0}}} * 285) +
(0{{{Nh|0}}} * 286) +
(0{{{Fl|0}}} * 289) +
(0{{{Mc|0}}} * 290) +
(0{{{Lv|0}}} * 293) +
(0{{{Ts|0}}} * 294) +
(0{{{Og|0}}} * 294) +
({{#if:{{{charge|}}}|{{Chem molar mass/calc charge|charge={{{charge|0}}} }}|0}})
}}<!-- end of value calculation #expr:
other parameters for /format:
-->
|round =<!--
can be: yes, no, smart, number, blank
rounding number can not and will not be greater than smart (=smart number of decimals)
-->{{#switch:{{lc:{{{round|smart}}}}}
|yes=yes<!-- min(2, smart) -->
|no=no<!-- smart -->
||default|smart = smart
|#default={{Ifnumber|{{{round|no}}}|{{formatnum:{{{round|0}}}|R}}|smart}}<!-- when number; min(number, smart) -->
}}
}}
| smart_round =
|{{{fixed|}}} }}<!--
{{#if: {{{Tc|}}}{{{Pm|}}}{{{Po|}}}{{{At|}}}{{{Rn|}}}{{{Fr|}}}{{{Ra|}}}{{{Ac|}}}{{{Np|}}}{{{Pu|}}}{{{Am|}}}{{{Cm|}}}{{{Bk|}}}{{{Cf|}}}{{{Es|}}}{{{Fm|}}}{{{Md|}}}{{{No|}}}{{{Lr|}}}{{{Rf|}}}{{{Db|}}}{{{Sg|}}}{{{Bh|}}}{{{Hs|}}}{{{Mt|}}}{{{Ds|}}}{{{Rg|}}}{{{Cn|}}}{{{Nh|}}}{{{Fl|}}}{{{Mc|}}}{{{Lv|}}}{{{Ts|}}}{{{Og|}}}

| 0
-->|yes=<!--
| {{#if:{{{Pb|}}}
-->{{ntsh|1={{#if:{{{fixed|}}} |{{#invoke:String|match|s={{{fixed|}}} |pattern=^[%d%.%-%−]+ |plain=false |nomatch={{{fixed|0}}} }} |{{{value|0}}}<!--
| 1
-->|debug=no}} }}<!-- in a sandbox, set debug=yes to show the hidden sortkey number.
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:{{{P|}}}{{{F|}}}
| 9
| {{#if:{{{D|}}}
| 11<!-- 11 because uncertainty=(40) -->
| {{#if:{{{charge|}}}
| 15
| 0 <!-- when no atoms/charges are entered at all; should not occur, will return blank
-->}} }} }} }} }} }} }} }} }} }} }} }}<!-- end of smart rounding number -->
| unit = {{{unit|}}}
| ref = {{{ref|}}}
| comment = {{{comment|}}}
| fixed = {{{fixed|}}}
| sortable= {{#ifeq:{{lc:{{{sortable|no}}}}}|yes|yes|no}}
}}<!--


-->{{#invoke:check for unknown parameters
suffixes, will always show:
|check
-->{{{ref|}}}{{#if:{{{comment|}}}|&#x20;{{{comment|}}}}}<!--
|unknown={{main other|[[Category:Pages using Chem molar mass with unsupported parameters|_VALUE_]]}}
--><noinclude>
{{documentation|1=Template:Chem molar mass/doc}}
|preview = Page using [[Template:Chem molar mass]] with unknown parameter "_VALUE_"
|ignoreblank=y
|fixed|unit|round|ref|comment|sortable|charge
<!--Period 1-->| H| D|He
<!--Period 2-->| Li| Be| B| C| N| O| F| Ne
<!--Period 3-->| Na| Mg| Al| Si| P| S| Cl| Ar
<!--Period 4-->| K| Ca| Sc| Ti| V| Cr| Mn| Fe| Co| Ni| Cu| Zn| Ga| Ge| As| Se| Br| Kr
<!--Period 5-->| Rb| Sr| Y| Zr| Nb| Mo| Tc| Ru| Rh| Pd| Ag| Cd| In| Sn| Sb| Te| I| Xe
<!--Period 6-->| Cs| Ba| La| Ce| Pr| Nd| Pm| Sm| Eu| Gd| Tb| Dy| Ho| Er| Tm| Yb| Lu| Hf| Ta| W| Re| Os| Ir| Pt| Au| Hg| Tl| Pb| Bi| Po| At| Rn
<!--Period 7-->| Fr| Ra| Ac| Th| Pa| U| Np| Pu| Am| Cm| Bk| Cf| Es| Fm| Md| No| Lr| Rf| Db| Sg| Bh| Hs| Mt| Ds| Rg| Cn| Nh| Fl| Mc| Lv| Ts| Og
<!--Period 8 not yet: Uue Ubn Ubu Ubb. Total: 118 elements+D -->
}}<!--


</noinclude>
--><noinclude>{{documentation}}</noinclude>

2024年1月5日 (五) 02:27的版本