Module:User:Mr. Stradivarius/RGConvert
Appearance
local data = [====[
|1000|1000mm|metre|meter|m|1|1m= {{RailGauge/compose|id=1000|dflt1=met|metric={{RailGauge/format met|m=|mm=1000|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=3|num=3|den=8|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1435|1435mm|sg|standard= {{RailGauge/compose|id=1435|dflt1=met|metric={{RailGauge/format met|mm=1435|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=4|in=8|num=1|den=2|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|56.5|56.5in|56.5"|4ft8.5in|4'8.5"|ussg|nasg|usstandard|nastandard= {{RailGauge/compose|id=1435|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=8|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1435|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1520|1520mm|1.52m|russian= {{RailGauge/compose|id=1520|dflt1=met|metric={{RailGauge/format met|mm=1520|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=4|in=11|num=5|den=6|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1668|1668mm|1.668m|iberian= {{RailGauge/compose|id=1668|dflt1=met|metric={{RailGauge/format met|mm=1668|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=5|in=5|num=2|den=3|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}<!--
Other gauges, ordered by size -->
|3mm= {{RailGauge/compose|id=3|dflt1=met|metric={{RailGauge/format met|mm=3|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.118|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|4mm= {{RailGauge/compose|id=4|dflt1=met|metric={{RailGauge/format met|mm=4|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.157|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|4.5mm= {{RailGauge/compose|id=4.5|dflt1=met|metric={{RailGauge/format met|mm=4.5|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.177|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|0.177|0.177in|0.177"= {{RailGauge/compose|id=4.5|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=0.177|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=4.5|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|4.8mm= {{RailGauge/compose|id=4.8|dflt1=met|metric={{RailGauge/format met|mm=4.8|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.189|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|0.250|0.250in|0.250"|0.25|0.25in|0.25"= {{RailGauge/compose|id=6.35|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=0.25|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=6.35|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|6.5mm= {{RailGauge/compose|id=6.5|dflt1=met|metric={{RailGauge/format met|mm=6.5|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.256|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|0.256|0.256in|0.256"= {{RailGauge/compose|id=6.5|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=0.256|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=6.5|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|0.276|0.276in|0.276"= {{RailGauge/compose|id=7|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=0.276|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=7|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|8mm= {{RailGauge/compose|id=8|dflt1=met|metric={{RailGauge/format met|mm=8|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.315|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|8.97mm= {{RailGauge/compose|id=8.97|dflt1=met|metric={{RailGauge/format met|mm=8.97|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.353|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|0.353|0.353in|0.353"= {{RailGauge/compose|id=8.97|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=0.353|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=8.97|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|9mm= {{RailGauge/compose|id=9|dflt1=met|metric={{RailGauge/format met|mm=9|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.354|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|9.42mm= {{RailGauge/compose|id=9.42|dflt1=met|metric={{RailGauge/format met|mm=9.42|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.371|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|10.5mm= {{RailGauge/compose|id=10.5|dflt1=met|metric={{RailGauge/format met|mm=10.5|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.413|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|0.413|0.413in|0.413"= {{RailGauge/compose|id=10.5|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=0.413|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=10.5|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|0.470|0.470in|0.470"|0.47in|0.47"= {{RailGauge/compose|id=11.94|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=0.470|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=11.94|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|12mm= {{RailGauge/compose|id=12|dflt1=met|metric={{RailGauge/format met|mm=12|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.472|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|12.7mm= {{RailGauge/compose|id=12.7|dflt1=met|metric={{RailGauge/format met|mm=12.7|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.5|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|0.5in|0.5"= {{RailGauge/compose|id=12.7|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=0.5|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=12.7|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|13mm= {{RailGauge/compose|id=13|dflt1=met|metric={{RailGauge/format met|mm=13|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.512|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|13.5mm= {{RailGauge/compose|id=13.5|dflt1=met|metric={{RailGauge/format met|mm=13.5|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.531|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|14mm= {{RailGauge/compose|id=14|dflt1=met|metric={{RailGauge/format met|mm=14|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.551|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|14.125mm= {{RailGauge/compose|id=14.125|dflt1=met|metric={{RailGauge/format met|mm=14.125|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.556|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|14.2mm= {{RailGauge/compose|id=14.2|dflt1=met|metric={{RailGauge/format met|mm=14.2|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.559|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|14.28mm= {{RailGauge/compose|id=14.28|dflt1=met|metric={{RailGauge/format met|mm=14.28|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.562|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|14.3mm= {{RailGauge/compose|id=14.3|dflt1=met|metric={{RailGauge/format met|mm=14.3|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.563|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|0.563|0.563in|0.563"= {{RailGauge/compose|id=14.3|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=0.563|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=14.3|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|15.75mm= {{RailGauge/compose|id=15.75|dflt1=met|metric={{RailGauge/format met|mm=15.75|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.620|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|16.2mm= {{RailGauge/compose|id=16.2|dflt1=met|metric={{RailGauge/format met|mm=16.2|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.638|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|16.5mm= {{RailGauge/compose|id=16.5|dflt1=met|metric={{RailGauge/format met|mm=16.5|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.65|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|0.650|0.650in|0.650"|0.65in|0.65"= {{RailGauge/compose|id=16.5|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=0.65|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=16.5|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|18mm= {{RailGauge/compose|id=18|dflt1=met|metric={{RailGauge/format met|mm=18|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.709|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|18.2mm= {{RailGauge/compose|id=18.2|dflt1=met|metric={{RailGauge/format met|mm=18.2|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.717|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|18.83mm= {{RailGauge/compose|id=18.83|dflt1=met|metric={{RailGauge/format met|mm=18.83|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.741|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|19mm= {{RailGauge/compose|id=19|dflt1=met|metric={{RailGauge/format met|mm=19|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.748|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|19.05mm= {{RailGauge/compose|id=19.05|dflt1=met|metric={{RailGauge/format met|mm=19.05|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.75|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|0.750in|0.750"|0.75in|0.75"= {{RailGauge/compose|id=19.05|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=0.75|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=19.05|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|19.4mm= {{RailGauge/compose|id=19.4|dflt1=met|metric={{RailGauge/format met|mm=19.4|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.764|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|20.5mm= {{RailGauge/compose|id=20.5|dflt1=met|metric={{RailGauge/format met|mm=20.5|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.807|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|21mm= {{RailGauge/compose|id=21|dflt1=met|metric={{RailGauge/format met|mm=21|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.827|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|0.865|0.865in|0.865"= {{RailGauge/compose|id=21.97|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=0.865|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=21.97|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|22mm= {{RailGauge/compose|id=22|dflt1=met|metric={{RailGauge/format met|mm=22|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.866|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|22.42mm= {{RailGauge/compose|id=22.42|dflt1=met|metric={{RailGauge/format met|mm=22.42|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.883|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|0.883|0.883in|0.883"= {{RailGauge/compose|id=22.42|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=0.883|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=22.42|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|22.5mm= {{RailGauge/compose|id=22.5|dflt1=met|metric={{RailGauge/format met|mm=22.5|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.886|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|23mm= {{RailGauge/compose|id=23|dflt1=met|metric={{RailGauge/format met|mm=23|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.906|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|24mm= {{RailGauge/compose|id=24|dflt1=met|metric={{RailGauge/format met|mm=24|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=0.945|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|28.08mm= {{RailGauge/compose|id=28.08|dflt1=met|metric={{RailGauge/format met|mm=28.08|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=1.106|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1.125|1.125in|1.125"= {{RailGauge/compose|id=28.6|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=1.125|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=28.6|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1.177|1.177in|1.177"= {{RailGauge/compose|id=29.9|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=1.177|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=29.9|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|30mm= {{RailGauge/compose|id=30|dflt1=met|metric={{RailGauge/format met|mm=30|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=1.181|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1.25|1.25in|1.25"= {{RailGauge/compose|id=31.75|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=1.25|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=31.75|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|32mm= {{RailGauge/compose|id=32|dflt1=met|metric={{RailGauge/format met|mm=32|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=1.26|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|32.96mm= {{RailGauge/compose|id=32.96|dflt1=met|metric={{RailGauge/format met|mm=32.96|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=1.298|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|33mm= {{RailGauge/compose|id=33|dflt1=met|metric={{RailGauge/format met|mm=33|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=1.3|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|35mm= {{RailGauge/compose|id=35|dflt1=met|metric={{RailGauge/format met|mm=35|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=1.378|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|36.75mm= {{RailGauge/compose|id=36.75|dflt1=met|metric={{RailGauge/format met|mm=36.75|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=1.447|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1.75in|1.75"= {{RailGauge/compose|id=44.45|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=1.75|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=44.45|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1.766|1.766in|1.766"= {{RailGauge/compose|id=44.85|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=1.766|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=44.85|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|45mm= {{RailGauge/compose|id=45|dflt1=met|metric={{RailGauge/format met|mm=45|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=1.772|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|49.20mm|49.2mm= {{RailGauge/compose|id=49.2|dflt1=met|metric={{RailGauge/format met|mm=49.20|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=1.937|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1.772|1.772in|1.772"= {{RailGauge/compose|id=45|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=1.772|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=45|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|50.8mm= {{RailGauge/compose|id=50.8|dflt1=met|metric={{RailGauge/format met|mm=50.8|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=2|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|2|2in|2"= {{RailGauge/compose|id=50.8|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=50.8|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|2.125in|2.125"= {{RailGauge/compose|id=53.975|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=2|num=1|den=8|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=53.975|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|63mm= {{RailGauge/compose|id=63|dflt1=met|metric={{RailGauge/format met|mm=63|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=2.48|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|63.5mm= {{RailGauge/compose|id=63.5|dflt1=met|metric={{RailGauge/format met|mm=63.5|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=2|num=1|den=2|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|2.5|2.5in|2.5"= {{RailGauge/compose|id=63.5|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=2|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=63.5|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|64|64mm= {{RailGauge/compose|id=64|dflt1=met|metric={{RailGauge/format met|mm=64|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=2.52|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|2.781|2.781in|2.781"= {{RailGauge/compose|id=70.64|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=2.781|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=70.64|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|89|89mm= {{RailGauge/compose|id=89|dflt1=met|metric={{RailGauge/format met|mm=89|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=3|num=1|den=2|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|3.5|3.5in|3.5"= {{RailGauge/compose|id=89|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=3|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=89|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|108|108mm= {{RailGauge/compose|id=108|dflt1=met|metric={{RailGauge/format met|mm=108|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=4|num=1|den=4|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|4.75|4.75in|4.75"= {{RailGauge/compose|id=121|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=4|num=3|den=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=121|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|127|127mm= {{RailGauge/compose|id=127|dflt1=met|metric={{RailGauge/format met|mm=127|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=5|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|5in|5"= {{RailGauge/compose|id=127|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=5|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=127|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|184|184mm= {{RailGauge/compose|id=184|dflt1=met|metric={{RailGauge/format met|mm=184|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=7|num=1|den=4|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|7.25|7.25in|7.25"= {{RailGauge/compose|id=184|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=7|num=1|den=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=184|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|190.5mm= {{RailGauge/compose|id=190.5|dflt1=met|metric={{RailGauge/format met|mm=190.5|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=7|num=1|den=2|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|7.5|7.5in|7.5"= {{RailGauge/compose|id=190.5|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=7|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=190.5|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|8.25|8.25in|8.25"= {{RailGauge/compose|id=210|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=8|num=1|den=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=210|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|9|9in|9"= {{RailGauge/compose|id=229|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=9|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=229|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|9.5|9.5in|9.5"= {{RailGauge/compose|id=241|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=9|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=241|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|254|254mm= {{RailGauge/compose|id=254|dflt1=met|metric={{RailGauge/format met|mm=254|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=10|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|10|10in|10"= {{RailGauge/compose|id=254|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=10|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=254|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|260|260mm|0.26m= {{RailGauge/compose|id=260|dflt1=met|metric={{RailGauge/format met|mm=260|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=10|num=1|den=4|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|10.25|10.25in|10.25"= {{RailGauge/compose|id=260|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=10|num=1|den=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=260|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|10.5in|10.5"= {{RailGauge/compose|id=267|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=10|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=267|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|305|305mm= {{RailGauge/compose|id=305|dflt1=met|metric={{RailGauge/format met|mm=305|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=12|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|12|12in|12"= {{RailGauge/compose|id=305|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=12|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=305|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|311|311mm= {{RailGauge/compose|id=311|dflt1=met|metric={{RailGauge/format met|mm=311|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=12|num=1|den=4|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|12.25|12.25in|12.25"= {{RailGauge/compose|id=311|dflt1=imp|imperial={{RailGauge/format imp|ft=|in=12|num=1|den=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=311|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|356|356mm= {{RailGauge/compose|id=356|dflt1=met|metric={{RailGauge/format met|mm=356|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=14|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|381|381mm= {{RailGauge/compose|id=381|dflt1=met|metric={{RailGauge/format met|mm=381|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=15|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|15|15in|15"|1ft3in|1'3"= {{RailGauge/compose|id=381|dflt1=imp|imperial={{RailGauge/format imp|in=15|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=381|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|400|400mm|0.4m= {{RailGauge/compose|id=400|dflt1=met|metric={{RailGauge/format met|mm=400|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=15|num=3|den=4|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|16|16in|16"|1ft4in|1'4"= {{RailGauge/compose|id=406|dflt1=imp|imperial={{RailGauge/format imp|in=16|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=406|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|16.5in|16.5"|1ft4.5in|1'4.5"= {{RailGauge/compose|id=419|dflt1=imp|imperial={{RailGauge/format imp|in=16|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=419|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|17|17in|17"|1ft5in|1'5"|1.5ft= {{RailGauge/compose|id=432|dflt1=imp|imperial={{RailGauge/format imp|in=17|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=432|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|450|450mm= {{RailGauge/compose|id=450|dflt1=met|metric={{RailGauge/format met|mm=450|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=17|num=23|den=32|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|457|457mm= {{RailGauge/compose|id=457|dflt1=met|metric={{RailGauge/format met|mm=457|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=18|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|18|18in|18"|1ft6in|1'6"|1.6ft= {{RailGauge/compose|id=457|dflt1=imp|imperial={{RailGauge/format imp|in=18|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=457|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|483|483mm= {{RailGauge/compose|id=483|dflt1=met|metric={{RailGauge/format met|mm=483|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=19|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|19|19in|19"|1ft7in|1'7"= {{RailGauge/compose|id=483|dflt1=imp|imperial={{RailGauge/format imp|in=19|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=483|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|19.5|19.5in|19.5"|1ft7.5in|1'7.5"= {{RailGauge/compose|id=495|dflt1=imp|imperial={{RailGauge/format imp|in=19|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=495|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|500|500mm|0.5m= {{RailGauge/compose|id=500|dflt1=met|metric={{RailGauge/format met|mm=500|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=19|num=3|den=4|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|508|508mm= {{RailGauge/compose|id=508|dflt1=met|metric={{RailGauge/format met|mm=508|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=20|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|20|20in|20"|1ft8in|1'8"= {{RailGauge/compose|id=508|dflt1=imp|imperial={{RailGauge/format imp|in=20|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=508|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|21in|21"|1ft9in|1'9"= {{RailGauge/compose|id=533|dflt1=imp|imperial={{RailGauge/format imp|in=21|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=533|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|557mm= {{RailGauge/compose|id=557|dflt1=met|metric={{RailGauge/format met|mm=557|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|in=21|num=15|den=16|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|559|559mm= {{RailGauge/compose|id=559|dflt1=met|metric={{RailGauge/format met|mm=559|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=1|in=10|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|22|22in|22"|1ft10in|1'10"= {{RailGauge/compose|id=559|dflt1=imp|imperial={{RailGauge/format imp|ft=1|in=10|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=559|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|578|578mm= {{RailGauge/compose|id=578|dflt1=met|metric={{RailGauge/format met|mm=578|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=1|in=10|num=3|den=4|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|22.75|22.75in|22.75"|1ft10.75in|1'10.75"= {{RailGauge/compose|id=578|dflt1=imp|imperial={{RailGauge/format imp|ft=1|in=10|num=3|den=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=578|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|597|597mm= {{RailGauge/compose|id=597|dflt1=met|metric={{RailGauge/format met|mm=597|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=1|in=11|num=1|den=2|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|23.5|23.5in|23.5"|1ft11.5in|1'11.5"= {{RailGauge/compose|id=597|dflt1=imp|imperial={{RailGauge/format imp|ft=1|in=11|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=597|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|600|600mm|0.6m= {{RailGauge/compose|id=600|dflt1=met|metric={{RailGauge/format met|mm=600|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=1|in=11|num=5|den=8|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|603|603mm= {{RailGauge/compose|id=603|dflt1=met|metric={{RailGauge/format met|mm=603|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=1|in=11|num=3|den=4|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|23.75|23.75in|23.75"|1ft11.75in|1'11.75"= {{RailGauge/compose|id=603|dflt1=imp|imperial={{RailGauge/format imp|ft=1|in=11|num=3|den=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=603|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|610|610mm= {{RailGauge/compose|id=610|dflt1=met|metric={{RailGauge/format met|mm=610|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|24|24in|24"|2ft|2'= {{RailGauge/compose|id=610|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=610|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|24.125|24.125in|24.125"|2ft0.125in|2'0.125"= {{RailGauge/compose|id=613|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=|num=1|den=8|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=613|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|622|622mm= {{RailGauge/compose|id=622|dflt1=met|metric={{RailGauge/format met|mm=622|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=|num=1|den=2|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|24.5|24.5in|24.5"|2ft0.5in|2'0.5"= {{RailGauge/compose|id=622|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=622|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|26|26in|26"|2ft2in|2'2"= {{RailGauge/compose|id=660|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=660|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|686|686mm= {{RailGauge/compose|id=686|dflt1=met|metric={{RailGauge/format met|mm=686|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=3|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|27|27in|27"|2ft3in|2'3"= {{RailGauge/compose|id=686|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=3|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=686|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|27.5|27.5in|27.5"|2ft3.5in|2'3.5"= {{RailGauge/compose|id=699|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=3|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=699|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|700|700mm|0.7m= {{RailGauge/compose|id=700|dflt1=met|metric={{RailGauge/format met|mm=700|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=3|num=9|den=16|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|27.75|27.75in|27.75"|2ft3.75in|2'3.75"= {{RailGauge/compose|id=705|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=3|num=3|den=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=705|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|711|711mm= {{RailGauge/compose|id=711|dflt1=met|metric={{RailGauge/format met|mm=711|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=4|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|28|28in|28"|2ft4in|2'4"= {{RailGauge/compose|id=711|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=711|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|28.5|28.5in|28.5"|2ft4.5in|2'4.5"= {{RailGauge/compose|id=724|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=4|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=724|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|29|29in|29"|2ft5in|2'5"= {{RailGauge/compose|id=737|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=5|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=737|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|750|750mm|0.75m= {{RailGauge/compose|id=750|dflt1=met|metric={{RailGauge/format met|mm=750|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=5|num=1|den=2|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|29.5|29.5in|29.5"|2ft5.5in|2'5.5"= {{RailGauge/compose|id=750|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=5|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=750|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|760|760mm|bosnian= {{RailGauge/compose|id=760|dflt1=met|metric={{RailGauge/format met|mm=760|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=5|num=15|den=16|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|762|762mm= {{RailGauge/compose|id=762|dflt1=met|metric={{RailGauge/format met|mm=762|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=6|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|30|30in|30"|2ft6in|2'6"|imperial= {{RailGauge/compose|id=762|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=6|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=762|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|765|765mm= {{RailGauge/compose|id=765|dflt1=met|metric={{RailGauge/format met|mm=765|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=6|num=1|den=8|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|30.5|30.5in|30.5"|2ft6.5in|2'6.5"= {{RailGauge/compose|id=775|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=6|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=775|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|783|783mm= {{RailGauge/compose|id=783|dflt1=met|metric={{RailGauge/format met|mm=783|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=6.83|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|785|785mm= {{RailGauge/compose|id=785|dflt1=met|metric={{RailGauge/format met|mm=785|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=6|num=9|den=10|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|800|800mm|0.8m= {{RailGauge/compose|id=800|dflt1=met|metric={{RailGauge/format met|mm=800|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=7|num=1|den=2|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|31.5|31.5in|31.5"|2ft7.5in|2'7.5"= {{RailGauge/compose|id=800|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=7|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=800|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|802|802mm= {{RailGauge/compose|id=802|dflt1=met|metric={{RailGauge/format met|mm=802|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=7|num=3|den=5|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|32|32in|32"|2ft8in|2'8"= {{RailGauge/compose|id=813|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=8|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=813|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|820|820mm= {{RailGauge/compose|id=820|dflt1=met|metric={{RailGauge/format met|mm=820|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=8|num=9|den=32|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|32.5|32.5in|32.5"|2ft8.5in|2'8.5"= {{RailGauge/compose|id=825|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=8|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=825|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|838|838mm= {{RailGauge/compose|id=838|dflt1=met|metric={{RailGauge/format met|mm=838|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=9|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|33|33in|33"|2ft9in|2'9"= {{RailGauge/compose|id=838|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=9|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=838|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|850|850mm= {{RailGauge/compose|id=850|dflt1=met|metric={{RailGauge/format met|mm=850|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=9|num=15|den=32|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|33.75|33.75in|33.75"|2ft9.75in|2'9.75"= {{RailGauge/compose|id=857|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=9|num=3|den=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=857|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|860|860mm= {{RailGauge/compose|id=860|dflt1=met|metric={{RailGauge/format met|mm=860|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=9|num=27|den=32|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|34|34in|34"|2ft10in|2'10"= {{RailGauge/compose|id=864|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=10|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=864|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|864|864mm= {{RailGauge/compose|id=864|dflt1=met|imperial={{RailGauge/format imp|ft=2|in=10|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=864|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|34.5|34.5in|34.5"|2ft10.5in|2'10.5"= {{RailGauge/compose|id=876|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=10|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=876|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|35|35in|35"|2ft11in|2'11"= {{RailGauge/compose|id=889|dflt1=imp|imperial={{RailGauge/format imp|ft=2|in=11|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=889|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|891|891mm= {{RailGauge/compose|id=891|dflt1=met|metric={{RailGauge/format met|mm=891|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=11|num=1|den=10|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|900|900mm|0.9m= {{RailGauge/compose|id=900|dflt1=met|metric={{RailGauge/format met|mm=900|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=2|in=11|num=7|den=16|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|914|914mm= {{RailGauge/compose|id=914|dflt1=met|metric={{RailGauge/format met|mm=914|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|36|36in|36"|3|3ft|3'= {{RailGauge/compose|id=914|dflt1=imp|imperial={{RailGauge/format imp|ft=3|in=|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=914|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|925|925mm= {{RailGauge/compose|id=925|dflt1=met|metric={{RailGauge/format met|mm=925|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=|num=13|den=32|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|37|37in|37"|3ft1in|3'1"= {{RailGauge/compose|id=940|dflt1=imp|imperial={{RailGauge/format imp|ft=3|in=1|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=940|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|37.125|37.125in|37.125"= {{RailGauge/compose|id=943|dflt1=imp|imperial={{RailGauge/format imp|ft=3|in=1|num=1|den=8|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=943|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|950|950mm= {{RailGauge/compose|id=950|dflt1=met|metric={{RailGauge/format met|mm=950|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=1|num=3|den=8|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|955|955mm= {{RailGauge/compose|id=955|dflt1=met|metric={{RailGauge/format met|mm=955|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=1|num=19|den=32|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|38|38in|38"|3ft2in|3'2"= {{RailGauge/compose|id=965|dflt1=imp|metric={{RailGauge/format met|mm=965|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=2|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|965|965mm= {{RailGauge/compose|id=965|dflt1=met|metric={{RailGauge/format met|mm=965|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=2|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|38.25|38.25in|38.25"|3ft2.25in|3'2.25"= {{RailGauge/compose|id=972|dflt1=imp|imperial={{RailGauge/format imp|ft=3|in=2|num=1|den=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=972|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}<!--
Metre moved to top for template speed -->
|39.375|39.375in|39.375"|3ft3.375in|3'3.75"= {{RailGauge/compose|id=1000|dflt1=imp|imperial={{RailGauge/format imp|ft=3|in=3|num=3|den=8|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1000|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1009|1009mm= {{RailGauge/compose|id=1009|dflt1=met|metric={{RailGauge/format met|mm=1009|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=3|num=23|den=32|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1016|1016mm= {{RailGauge/compose|id=1016|dflt1=met|metric={{RailGauge/format met|mm=1016|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=4|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|40|40in|40"|3ft4in|3'4"= {{RailGauge/compose|id=1016|dflt1=imp|imperial={{RailGauge/format imp|ft=3|in=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1016|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|40.5|40.5in|40.5"|3ft4.5in|3'4.5"= {{RailGauge/compose|id=1029|dflt1=imp|imperial={{RailGauge/format imp|ft=3|in=4|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1029|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|40.75|40.75in|40.75"|3ft4.75in|3'4.75"= {{RailGauge/compose|id=1035|dflt1=imp|imperial={{RailGauge/format imp|ft=3|in=4|num=3|den=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1035|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1050|1050mm= {{RailGauge/compose|id=1050|dflt1=met|metric={{RailGauge/format met|mm=1050|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=5|num=1|den=3|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1055|1055mm= {{RailGauge/compose|id=1055|dflt1=met|metric={{RailGauge/format met|mm=1055|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=5|num=1|den=2|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|41.5|41.5in|41.5"|3ft5.5in|3'5.5"= {{RailGauge/compose|id=1055|dflt1=imp|imperial={{RailGauge/format imp|ft=3|in=5|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1055|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1062|1062mm= {{RailGauge/compose|id=1062|dflt1=met|metric={{RailGauge/format met|mm=1062|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=5|num=13|den=16|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1065mm= {{RailGauge/compose|id=1065|dflt1=met|metric={{RailGauge/format met|mm=1065|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=5|num=15|den=16|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1067|1067mm= {{RailGauge/compose|id=1067|dflt1=met|metric={{RailGauge/format met|mm=1067|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=6|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|42|42in|3ft6in|3.6ft|3'6"|cape= {{RailGauge/compose|id=1067|dflt1=imp|imperial={{RailGauge/format imp|ft=3|in=6|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1067|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1093|1093mm= {{RailGauge/compose|id=1093|dflt1=met|metric={{RailGauge/format met|mm=1093|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=7|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|43|43in|3ft7in|3.7ft|3'7"= {{RailGauge/compose|id=1093|dflt1=imp|imperial={{RailGauge/format imp|ft=3|in=7|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1093|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1100|1100mm|1.1m= {{RailGauge/compose|id=1100|dflt1=met|metric={{RailGauge/format met|mm=1100|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=7|num=7|den=16|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1106|1106mm= {{RailGauge/compose|id=1106|dflt1=met|metric={{RailGauge/format met|mm=1106|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=7|num=1|den=2|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|43.5|43.5in|43.5"|3ft7.5in|3'7.5"= {{RailGauge/compose|id=1106|dflt1=imp|imperial={{RailGauge/format imp|ft=3|in=7|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1106|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|44.25|44.25in|44.25"|3ft8.25in|3'8.25"= {{RailGauge/compose|id=1124|dflt1=imp|imperial={{RailGauge/format imp|ft=3|in=8|num=1|den=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1124|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|44.5|44.5in|44.5"|3ft8.5in|3'8.5"= {{RailGauge/compose|id=1130|dflt1=imp|imperial={{RailGauge/format imp|ft=3|in=8|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1130|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|45|45in|45"|3ft9in|3'9"= {{RailGauge/compose|id=1143|dflt1=imp|imperial={{RailGauge/format imp|ft=3|in=9|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1143|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|45.5|45.5in|45.5"|3ft9.5in|3'9.5"= {{RailGauge/compose|id=1156|dflt1=imp|imperial={{RailGauge/format imp|ft=3|in=9|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1156|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1188|1188mm= {{RailGauge/compose|id=1188|dflt1=met|metric={{RailGauge/format met|mm=1188|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=10|num=4|den=5|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|47|47in|47"|3ft11in|3'11"= {{RailGauge/compose|id=1194|dflt1=imp|imperial={{RailGauge/format imp|ft=3|in=11|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1194|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1200|1200mm= {{RailGauge/compose|id=1200|dflt1=met|metric={{RailGauge/format met|mm=1200|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=11|num=1|den=4|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1217|1217mm= {{RailGauge/compose|id=1217|dflt1=met|metric={{RailGauge/format met|mm=1217|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=3|in=11|num=9|den=10|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1219|1219mm= {{RailGauge/compose|id=1219|dflt1=met|metric={{RailGauge/format met|mm=1219|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=4|in=|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|48|48in|48"|4|4ft|4'= {{RailGauge/compose|id=1219|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1219|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1245|1245mm= {{RailGauge/compose|id=1245|dflt1=met|metric={{RailGauge/format met|mm=1245|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=4|in=1|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|49|49in|49"|4ft1in|4'1"= {{RailGauge/compose|id=1245|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=1|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1245|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|49.5|49.5in|49.5"|4ft1.5in|4'1.5"= {{RailGauge/compose|id=1257|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=1|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1257|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1270|1270mm= {{RailGauge/compose|id=1270|dflt1=met|metric={{RailGauge/format met|mm=1270|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=4|in=2|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|50|50in|50"|4ft2in|4'2"= {{RailGauge/compose|id=1270|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1270|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1295|1295mm= {{RailGauge/compose|id=1295|dflt1=met|metric={{RailGauge/format met|mm=1295|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=4|in=3|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|51|51in|51"|4ft3in|4'3"= {{RailGauge/compose|id=1295|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=3|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1295|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|52|52in|52"|4ft4in|4'4"= {{RailGauge/compose|id=1321|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1321|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|52.5|52.5in|52.5"|4ft4.5in|4'4.5"= {{RailGauge/compose|id=1333|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=4|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1333|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1372|1372mm= {{RailGauge/compose|id=1372|dflt1=met|metric={{RailGauge/format met|mm=1372|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=4|in=6|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|54|54in|54"|4ft6in|4'6"|scotch= {{RailGauge/compose|id=1372|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=6|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1372|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|54.5|54.5in|54.5"|4ft6.5in|4'6.5"= {{RailGauge/compose|id=1384|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=6|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1384|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|55.5|55.5in|55.5"|4ft7.5in|4'7.5"= {{RailGauge/compose|id=1410|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=7|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1410|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|55.75|55.75in|55.75"|4ft7.75in|4'7.75"= {{RailGauge/compose|id=1416|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=7|num=3|den=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1416|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1422|1422mm= {{RailGauge/compose|id=1422|dflt1=met|metric={{RailGauge/format met|mm=1422|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=4|in=8|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|56|56in|56"|4ft8in|5'8"= {{RailGauge/compose|id=1422|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=8|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1422|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|56.25|56.25in|56.25"|4ft8.25in|4'8.25"= {{RailGauge/compose|id=1429|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=8|num=1|den=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1429|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1432|1432mm= {{RailGauge/compose|id=1432|dflt1=met|metric={{RailGauge/format met|mm=1432|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=4|in=8|num=3|den=8|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}<!--
Standard gauge moved to top to speed up template --><!--
US standard gauge moved to top for template speed -->
|1440|1440mm= {{RailGauge/compose|id=1440|dflt1=met|metric={{RailGauge/format met|mm=1440|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=4|in=8|num=11|den=16|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1445|1445mm= {{RailGauge/compose|id=1445|dflt1=met|metric={{RailGauge/format met|mm=1445|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=4|in=8|num=7|den=8|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|57|57in|57"|4ft9in|4'9"= {{RailGauge/compose|id=1448|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=9|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1448|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1450|1450mm= {{RailGauge/compose|id=1450|dflt1=met|metric={{RailGauge/format met|mm=1450|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=4|in=9|num=3|den=32|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1458|1458mm= {{RailGauge/compose|id=1458|dflt1=met|metric={{RailGauge/format met|mm=1458|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=4|in=9|num=13|den=32|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|57.5|57.5"|57.5in|4ft9.5in|4'9.5"= {{RailGauge/compose|id=1460|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=9|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1460|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1473|1473mm= {{RailGauge/compose|id=1473|dflt1=met|metric={{RailGauge/format met|mm=1473|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=4|in=10|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|58|58"|58in|4ft10in|4'10"|ohio= {{RailGauge/compose|id=1473|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=10|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1473|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|58.75|58.75in|58.75"|4ft10.75in|4'10.75"= {{RailGauge/compose|id=1492|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=10|num=3|den=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1492|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1495|1495mm|toronto= {{RailGauge/compose|id=1495|dflt1=met|metric={{RailGauge/format met|mm=1495|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=4|in=10|num=7|den=8|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|58.875|58.875in|58.875"|4ft10.875in|4'10.875"= {{RailGauge/compose|id=1495|dflt1=imp|imperial={{RailGauge/format imp|ft=4|in=10|num=7|den=8|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1495|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1500|1500mm|1.5m= {{RailGauge/compose|id=1500|dflt1=met|metric={{RailGauge/format met|mm=1500|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=4|in=11|num=1|den=16|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}<!--
Russian gauge moved to top to speed up template -->
|1524|1524mm= {{RailGauge/compose|id=1524|dflt1=met|metric={{RailGauge/format met|mm=1524|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=5|in=|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|60|60in|60"|5|5ft|5'= {{RailGauge/compose|id=1524|dflt1=imp|imperial={{RailGauge/format imp|ft=5|in=|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1524|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|60.5|60.5in|60.5"|5ft0.5in|5'0.5"= {{RailGauge/compose|id=1537|dflt1=imp|imperial={{RailGauge/format imp|ft=5|in=|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1537|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|62|62in|62"|5ft2in|5'2"= {{RailGauge/compose|id=1575|dflt1=imp|imperial={{RailGauge/format imp|ft=5|in=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1575|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|62.1875|62.1875in|62.1875"|5ft2.1875in|5'2.1875"= {{RailGauge/compose|id=1580|dflt1=imp|imperial={{RailGauge/format imp|ft=5|in=2|num=3|den=16|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1580|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1581|1581mm= {{RailGauge/compose|id=1581|dflt1=met|metric={{RailGauge/format met|mm=1581|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=5|in=2|num=1|den=4|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|62.25|62.25in|62.25"|5ft2.25in|5'2.25"|pennsylvanian|pennsylvania= {{RailGauge/compose|id=1581|dflt1=imp|imperial={{RailGauge/format imp|ft=5|in=2|num=1|den=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1581|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1588|1588mm= {{RailGauge/compose|id=1588|dflt1=met|metric={{RailGauge/format met|mm=1588|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=5|in=2|num=1|den=2|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|62.5|62.5in|62.5"|5ft2.5in|5'2.5"= {{RailGauge/compose|id=1588|dflt1=imp|imperial={{RailGauge/format imp|ft=5|in=2|num=1|den=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1588|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1600|1600mm|1.6m|victorian|irish= {{RailGauge/compose|id=1600|dflt1=met|metric={{RailGauge/format met|mm=1600|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=5|in=3|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|63|63in|63"|5ft3in|5'3"= {{RailGauge/compose|id=1600|dflt1=imp|imperial={{RailGauge/format imp|ft=5|in=3|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1600|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1664|1664mm= {{RailGauge/compose|id=1664|dflt1=met|metric={{RailGauge/format met|mm=1664|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=5|in=5|num=1|den=2|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}<!--
Iberian gauge moved to top to speed up template -->
|1672|1672mm= {{RailGauge/compose|id=1672|dflt1=met|metric={{RailGauge/format met|mm=1672|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=5|in=5|num=5|den=6|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1676|1676mm= {{RailGauge/compose|id=1676|dflt1=met|metric={{RailGauge/format met|mm=1676|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=5|in=6|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|66|66in|66"|5ft6in|5'6"|5.5ft|provincial|indian= {{RailGauge/compose|id=1676|dflt1=imp|imperial={{RailGauge/format imp|ft=5|in=6|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1676|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1680|1680mm= {{RailGauge/compose|id=1680|dflt1=met|metric={{RailGauge/format met|mm=1680|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=5|in=6|num=5|den=32|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1750|1750mm|1.75m= {{RailGauge/compose|id=1750|dflt1=met|metric={{RailGauge/format met|m=1.75|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=5|in=8|num=7|den=8|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1829|1829mm= {{RailGauge/compose|id=1829|dflt1=met|metric={{RailGauge/format met|mm=1829|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=6|in=|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|72|72in|72"|6|6ft|6'= {{RailGauge/compose|id=1829|dflt1=imp|imperial={{RailGauge/format imp|ft=6|in=|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1829|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1880|1880mm= {{RailGauge/compose|id=1880|dflt1=met|metric={{RailGauge/format met|mm=1880|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=6|in=2|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|74|74in|74"|6ft2in|6'2"= {{RailGauge/compose|id=1880|dflt1=imp|imperial={{RailGauge/format imp|ft=6|in=2|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=1880|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|1945|1945mm= {{RailGauge/compose|id=1945|dflt1=met|metric={{RailGauge/format met|mm=1945|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=6|in=4|num=9|den=16|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|2000|2000mm|2m= {{RailGauge/compose|id=2000|dflt1=met|metric={{RailGauge/format met|mm=2000|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=6|in=6|num=3|den=4|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|2140|2140mm|2.140m|2.14m= {{RailGauge/compose|id=2140|dflt1=met|metric={{RailGauge/format met|mm=2140|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=7|in=|num=1|den=4|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|84|84in|84"|7|7ft|7'|84.25|84.25in|84.25"|7ft0.25in|7'0.25"|brunel= {{RailGauge/compose|id=2140|dflt1=imp|imperial={{RailGauge/format imp|ft=7|in=|num=1|den=4|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=2140|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|3000|3000mm|3m= {{RailGauge/compose|id=3000|dflt1=met|metric={{RailGauge/format met|m=3|lk={{{lk|}}}}}|imperial={{RailGauge/format imp|ft=9|in=10|num=1|den=8|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
|120|120in|120"|10ft|10'= {{RailGauge/compose|id=3048|dflt1=imp|imperial={{RailGauge/format imp|ft=10|in=|lk={{{lk|}}}}}|metric={{RailGauge/format met|mm=3048|lk={{{lk|}}}}}|first={{{first|}}}|disp={{{disp|}}}|wrap={{{wrap|}}}}}
]====]
local named = [===[
|760|760mm|bosnian= {{nowrap|{{#ifeq:{{lc:{{{allk|}}}}}|on|[[Bosnian gauge]]|Bosnian gauge}}}}
|30|30in|30"|2ft6in|2'6"|imperial= {{nowrap|{{#ifeq:{{lc:{{{allk|}}}}}|on|[[Imperial gauge]]|Imperial gauge}}}}
|1000|1000mm|metre|meter|m|1m|39.375|39.375in|39.375"|3ft3.375in|3'3.75"= {{nowrap|{{#ifeq:{{lc:{{{allk|}}}}}|on|[[Metre gauge|metre gauge]]|metre gauge}}}}
|1067|1067mm|42|42in|3ft6in|3.5ft|3'6"|cape= {{nowrap|{{#ifeq:{{lc:{{{allk|}}}}}|on|[[Cape gauge]]|Cape gauge}}}}
|1435|1435mm|sg|standard|56.5|56.5in|56.5"|4ft8.5in|4'8.5"|ussg|nasg|usstandard|nastandard= {{nowrap|{{#ifeq:{{lc:{{{allk|}}}}}|on|[[Standard gauge|standard gauge]]|standard gauge}}}}
|1473|1473mm|58|58"|58in|4ft10in|4'10"|ohio= {{nowrap|{{#ifeq:{{lc:{{{allk|}}}}}|on|[[Ohio gauge]]|Ohio gauge}}}}
|1495|1495mm|toronto= {{nowrap|{{#ifeq:{{lc:{{{allk|}}}}}|on|[[Toronto gauge]]|Toronto gauge}}}}
|1520|1520mm|1.52m|russian= {{nowrap|{{#ifeq:{{lc:{{{allk|}}}}}|on|[[Russian gauge]]|Russian gauge}}}}
|54|54in|54"|4ft6in|4'6"|scotch= {{nowrap|{{#ifeq:{{lc:{{{allk|}}}}}|on|[[Scotch gauge]]|Scotch gauge}}}}
|62.25|62.25in|62.25"|5ft2.25in|5'2.25"|1588|1588mm|pennsylvanian|pennsylvania = {{nowrap|{{#ifeq:{{lc:{{{allk|}}}}}|on|[[Pennsylvanian trolley gauge]]|Pennsylvanian trolley gauge}}}}
|1600|1600mm|1.6|1.6m|63|63in|63"|5ft3in|5'3"|victorian|irish= {{nowrap|{{#ifeq:{{lc:{{{allk|}}}}}|on|[[Irish gauge]]|Irish gauge}}}}
|1668|1668mm|1.668|1.668m|iberian= {{nowrap|{{#ifeq:{{lc:{{{allk|}}}}}|on|[[Iberian gauge]]|Iberian gauge}}}}
|1676|1676mm|66|66in|66"|5ft6in|5'6"|5.5ft|provincial|indian= {{nowrap|{{#ifeq:{{lc:{{{allk|}}}}}|on|[[Indian gauge]]|Indian gauge}}}}
|2140|2140mm|2.140m|2.14m|84|84in|84"|7|7ft|7'|84.25|84.25in|84.25"|7ft0.25in|7'0.25"| brunel= {{nowrap|{{#ifeq:{{lc:{{{allk|}}}}}|on|[[Brunel gauge]]|Brunel gauge}}}}
]===]
local p = {}
local dts = require('Module:User:Anomie/deepToString').deepToString -- for debugging
-- Replaces bar characters with a pseudo-random string for converting back later.
local function debar( s )
local s = mw.ustring.gsub( s, '|', 'DEBARRED-29vuy7dsgtz87465gfbq29gr1bzj-DERRABED' )
return s
end
-- Undoes the transformation done by debar().
local function rebar( s )
local s = mw.ustring.gsub( s, 'DEBARRED%-29vuy7dsgtz87465gfbq29gr1bzj%-DERRABED', '|' )
return s
end
local function findTemplate( s, pattern )
for braces in mw.ustring.gmatch( s, '{%b{}}' ) do
braces = mw.ustring.sub( braces, 3, -3 )
if mw.ustring.match( braces, pattern ) then
return braces
end
local recursion = findTemplate( braces, pattern )
if recursion then
return recursion
end
end
end
-- Searches a string for the first instance of the specified template, and returns a table with the template arguments.
local function getTemplateArgs( s, pattern )
-- Find the template text.
local template = findTemplate( s, pattern )
if not template then
return nil
end
-- Temporarily replace characters inside [[]] or {{}} with a quasi-random code. The bars that are left delineate the template's parameters.
template = mw.ustring.gsub( template, '{%b{}}', debar )
template = mw.ustring.gsub( template, '%[%b[]%]', debar )
-- Build the table of parameters.
local params = {}
for field in mw.ustring.gmatch( template, '|([^|]*)' ) do
local param, value = nil, nil
if mw.ustring.find( field, '=' ) then
param, value = mw.ustring.match( field, '%s*([^=]-)%s*=(.*)' )
value = value or ''
value = mw.text.trim( value )
else
value = field
end
if param then
paramNum = tonumber( param )
if paramNum and paramNum >= 1 and math.floor( paramNum ) == paramNum and paramNum ~= math.huge then
param = paramNum
end
if not value then
params[ mw.ustring.lower( param ) ] = ''
else
params[ mw.ustring.lower( param ) ] = value
end
else
table.insert( params, value )
end
end
-- Replace the quasi-random code with the bars again.
for k, v in pairs( params ) do
params[ k ] = rebar( v )
end
return params
end
function p.main()
local template = data
-- Temporarily replace characters inside [[]] or {{}} with a quasi-random code. The bars that are left delineate the template's parameters.
template = mw.ustring.gsub( template, '{%b{}}', debar )
template = mw.ustring.gsub( template, '%[%b[]%]', debar )
-- Build the table of parameters.
local ret = {}
local aliases = {}
for field in mw.ustring.gmatch( template, '|([^|]*)' ) do
local param, value
if mw.ustring.find( field, '=' ) then
param, value = mw.ustring.match( field, '%s*([^=]-)%s*=(.*)' )
value = mw.text.trim( value )
else
value = field
end
if param then
table.insert( aliases, param )
value = rebar( value )
local params = {}
params.compose = getTemplateArgs( value, '^%s*[rR]ailGauge/compose%s*[|}]' )
params.met = getTemplateArgs( value, '^%s*[rR]ailGauge/format met%s*[|}]' )
params.imp = getTemplateArgs( value, '^%s*[rR]ailGauge/format imp%s*[|}]' )
local name, link
named = mw.ustring.gsub( named, '{%b{}}', debar )
named = mw.ustring.gsub( named, '%[%b[]%]', debar )
local naliases = {}
for nfield in mw.ustring.gmatch( named, '|([^|]*)' ) do
local nparam, nvalue
if mw.ustring.find( nfield, '=' ) then
nparam, nvalue = mw.ustring.match( nfield, '%s*([^=]-)%s*=(.*)' )
nvalue = mw.text.trim( nvalue )
else
nvalue = nfield
end
if nparam then
table.insert( naliases, nvalue )
for i, nalias in ipairs( naliases ) do
for j, alias in ipairs( aliases ) do
if nalias == alias then
local namedArgs = getTemplateArgs( rebar( nvalue ), '^#ifeq:{{lc:{{{allk|}}}}}|' )
name = namedArgs[ 3 ]
link = namedArgs[ 2 ]
end
end
end
naliases = {}
else
table.insert( naliases, nvalue )
end
end
local id = params.compose.id
local rowVals = {}
table.insert( rowVals, mw.ustring.format( '["id"] = "%s"', id ) )
local aliasText = mw.ustring.format( '["aliases"] = { [[%s]] }', table.concat( aliases, ']], [[' ) )
table.insert( rowVals, aliasText )
if name then
table.insert( rowVals, mw.ustring.format( '["name"] = "%s"', name ) )
end
if link then
table.insert( rowVals, mw.ustring.format( '["link"] = "%s"', link ) )
end
local function insertRowVals( t )
local paramTable = t[1]
local paramName = t[2]
if params[ paramTable ][ paramName ] and mw.ustring.find( params[ paramTable ][ paramName ], '%S' ) then
table.insert( rowVals, mw.ustring.format( '["%s"] = "%s"', paramName, params[ paramTable ][ paramName ] ) )
end
end
if params.compose.dflt1 == 'imp' then
for i, v in ipairs( { {'compose', 'dflt1'}, {'imp', 'ft'}, {'imp', 'in'}, {'imp', 'num'}, {'imp', 'den'}, {'met', 'm'}, {'met', 'mm'} } ) do
insertRowVals( v )
end
else
for i, v in ipairs( { {'compose', 'dflt1'}, {'met', 'm'}, {'met', 'mm'}, {'imp', 'ft'}, {'imp', 'in'}, {'imp', 'num'}, {'imp', 'den'} } ) do
insertRowVals( v )
end
end
table.insert( ret, mw.ustring.format( '{\n %s\n }', table.concat( rowVals, ',\n ') ) )
aliases = {}
else
table.insert( aliases, value )
end
end
return 'return {\n ' .. table.concat( ret, ',\n ' ) .. '\n}'
end
return p