Template:Molecular formula Hill key/doc

Generates a string version of the molecular formula suitable for sorting in Hill order. Every element that is present is given a fixed-width zero-padded field for the number of atoms present (currently field-width=5, based on largest formula in Category:Set index articles on molecular formulas). It can thus be used as a hidden key in a sortable table (see Help:Sortable tables).