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 40:
txt.value = txt.value.replace(/km\/h/gi, 'km/h');
txt.value = txt.value.replace(/(\d)\s?km\/h/gi, '$1 km/h');
txt.value = txt.value.replace(/(\d)\-km\/h/gi, '$1 km/h');
 
 
Line 57 ⟶ 58:
txt.value = txt.value.replace(/mph/gi, 'mph');
txt.value = txt.value.replace(/(\d)\s?mph/gi, '$1 mph');
txt.value = txt.value.replace(/(\d)\-mph/gi, '$1 mph');
 
 
txt.value = txt.value.replace(/(rpm)/gi, 'rpm');
txt.value = txt.value.replace(/(\d)\s?(rpm)/gi, '$1 rpm');
txt.value = txt.value.replace(/(\d)\-rpm/gi, '$1 rpm');
 
// Standardise symbol for pounds
Line 73 ⟶ 76:
// Standardise symbol for kilowatts
txt.value = txt.value.replace(/(\d)\s?kW/gi, '$1 kW');
txt.value = txt.value.replace(/(\d)\-kW/gi, '$1 kW');
 
// Standardise symbol for foot pounds
txt.value = txt.value.replace(/(ft[ -.•\/]lb[fs])/gi, 'ft·lbf');
txt.value = txt.value.replace(/(lb[fs][ -.•\/]ft)/gi, 'ft·lbf');
txt.value = txt.value.replace(/(lb[ -.•\/]ft)/gi, 'ft·lbf');
txt.value = txt.value.replace(/(ft[ -.•\/]lb)/gi, 'ft·lbf');
 
// Symbols for feet and inches
Line 89 ⟶ 93:
 
// Give digital value a percent symbol '%' instead of word
txt.value = txt.value.replace(/(\d)[\s?-]per ?cent([^aei])/gi, '$1%$2');
txt.value = txt.value.replace(/(\d)\-per ?cent([^aei])/gi, '$1%$2');
 
// Add a space before dB or B