Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Search
Search
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Template:Chem molar mass/format
Template
Discussion
English
Read
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit source
View history
Move
General
What links here
Related changes
Special pages
Page information
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{#if:{{{fixed|}}}|{{#ifexpr:{{{value|}}}>0|[[Category:Chem-molar-mass both hardcoded and calculated]]}}}}{{#iferror:{{{value|}}}<!-- iferror: true -->|{{#if:{{{fixed|}}}|<!-- error in fixed, return as is: -->{{{fixed|}}}|<!-- error is in calculation: --><sup class="noprint Inline-Template" style="white-space:nowrap;">[''[[Wikipedia:WikiProject Chemicals/Molar mass#Cannot calculate molar mass|<span title="Cannot calculate molar mass from chemical formula)">cannot calculate</span>]]'']</sup>}}{{main other|[[Category:Articles with erroneous molar mass calculations]]}}<!-- iferror:false prefix: hidden sortkey ntsh buggy: this way, sorted is the non-rounded value... -->|{{#ifeq:{{{sortable|no}}}|yes|{{ntsh|1={{#if:{{{fixed|}}}|{{#invoke:String|match|s={{{fixed|}}} |pattern=^[%d%.%-%−]+ |plain=false |nomatch={{{fixed|0}}}}} |{{{value|0}}} }} |debug=no<!-- set to =yes to test/show the hidden key -->}} }}<!-- round the value: parameter round can be: yes, no, smart, number. rounding number cannot be greater than smart (=smart number of decimals), so use min(,). smart number cannot be empty, but is covered with "|2" here -->{{#if:{{{fixed|}}}|{{{fixed|}}}| {{#ifexpr:{{{value|0}}}=0|<!-- no input, no value output -->|{{val|{{#invoke:math|precision_format |{{{value|0}}} |{{#switch:{{{round|smart}}} |yes={{min|2|{{{smart_round|2}}}}}<!-- min(2, smart) --> |no={{{smart_round|2}}}<!-- smart --> ||default|smart={{{smart_round|2}}} |#default={{min|{{{round|0}}}|{{{smart_round|2}}}}}<!-- when number; min(number, smart) -->}} }} }} }} }}<!-- iferror: close -->}}<!-- suffix: if sort=no then add unit -->{{#ifexpr:{{{value|0}}}=0||{{#ifeq:|{{{sortable|unk}}}|no| {{#if:{{{unit|}}} |{{{unit|}}}|g·mol<sup>−1</sup>}}}}}}<!-- suffixes, will always show: -->{{{ref|}}}{{#if:{{{comment|}}}| {{{comment|}}}}}<!-- -xxx-> <small>(debug:smart_round={{{smart_round|(blank)}}})</small><!-- --><noinclude>{{documentation|1=Template:Chem molar mass/doc}}</noinclude>
Summary:
Please note that all contributions to Ikwipedia are considered to be released under the Creative Commons Attribution-ShareAlike (see
Ikwipedia:Copyrights
for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource.
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Toggle limited content width