Template:Convert/hand

The Template:Convert/hand converts hands of horse height, such as with inches, metres or cm. The conversion is 1 hand = 4 inches. A fraction indicates inches, so "13.2" denotes 13 + 1/2 hands, rather than 2/10 or 1/5 hand. Examples:
 * {&#123;convert|57|in|hand}} &rarr; 57 in
 * {&#123;convert|14.1|hand|in}} &rarr; 14.1 hand
 * {&#123;convert|14.1|hand|cm}} &rarr; 14.1 hand
 * {&#123;convert|50|-|57|in|hand}} &rarr; 50 - 57 in
 * {&#123;convert|2|-|3|m|hand}} &rarr; 2 - 3 m
 * {&#123;convert|57|or|59|in|hand|abbr=on}} &rarr; 57 or
 * {&#123;convert|137|-|139|cm|hand|lk=on}} &rarr; 137 - 139 cm
 * {&#123;convert|37|–|162|cm|hand|2|abbr=in|lk=out}} &rarr; 37 –
 * {&#123;convert|37|–|162|cm|hand|0|abbr=in|lk=in}} &rarr; 37 –

Unlike most Convert subtemplates, Convert/hand has 4 sections of special calculations to transform amounts in "hands.inches" notation, for x-to-hands, hands-to-x, range-to-hands, or hands-to-range of other units. The logic changes any fractional hands into decimals .1, .2 or .3 by checking parameter 2 to have "(" using {&#123;padleft:|1| }} then resetting parameter 2, with the fraction multiplied by 100 & divided by 250, as one-tenth the multiple of 25. This is the first Convert subtemplate to calculate numbers which are not in decimal format (where ".1" is 1/4 not 1/10), as would be a complex format also for hexadecimal or binary numbers.