User:Thespaceface/ImperialFirst

Introduction
If metric units are listed first, this script flips the words around to put imperial first.

Examples
this script turns into (respectively)
 * 89 kilometres (55 mi)
 * 89 km (55 mi)
 * 89 km[1] (55 mi)
 * 55 miles (89 km)
 * 55 mi (89 km)
 * 55 mi[1] (89 km)

Installation (English Wikipedia)
importScript("User:Thespaceface/ImperialFirst.js");

Source
see User:Thespaceface/ImperialFirst.js