User:Bobblewik/monobook.js/unitformatter.js: Difference between revisions

Content deleted Content added
Bobblewik (talk | contribs)
mNo edit summary
Bobblewik (talk | contribs)
mNo edit summary
Line 39:
txt.value = txt.value.replace(/(\d)\s?(kmh)/gi, '$1 km/h');
txt.value = txt.value.replace(/(km\/h)/gi, 'km/h');
txt.value = txt.value.replace(/(\d)\s?(km/h)/gi, '$1 km/h');
 
 
// Space before horsepower symbol
txt.value = txt.value.replace(/(\d)\s?(hp)/gi, '$1 hp');
txt.value = txt.value.replace(/(\d)\s?(bhp)/gi, '$1 bhp');
txt.value = txt.value.replace(/(\d)\s?(shp)/gi, '$1 shp');
 
 
// Space before other units
Line 53 ⟶ 56:
txt.value = txt.value.replace(/(m.p.h.)/gi, 'mph');
txt.value = txt.value.replace(/(mph)/gi, 'mph');
txt.value = txt.value.replace(/(\d)\s?(mph)/gi, '$1 mph');
 
 
txt.value = txt.value.replace(/(rpm)/gi, 'rpm');
txt.value = txt.value.replace(/(\d)\s?(rpm)/gi, '$1 rpm');
 
// Standardise symbol for pounds