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 15:
txt.value = txt.value.replace(/³/g, '³');
 
// Convert the word ohm(s) or the html entity into the actual Ω symbol (Omega, not the actual ohm symbol Ω) and make sure it's is spaced
txt.value = txt.value.replace(/(\d)\s?(Y|Z|E|P|T|G|M|k|K|h|da|d|c|m|µ|μ|µ|n|p|f|a|z|y)?\s?(Ω|ohm|Ohm)s?([\s,.;:\)\(\\/)])/g, '$1 $2Ω$4');
 
Line 30:
 
// Fix kilometres
txt.value = txt.value.replace(/(\d)\s?kms?([\s,.;:\)\(\\/)])/gi, '$1 km$2');
txt.value = txt.value.replace(/(\d)\-kms?([\s,.;:\)\(\\/)])/gi, '$1 km$2');
 
// Standardise kilometres per hour
Line 75:
 
// Standardise symbol for kilowatts
txt.value = txt.value.replace(/(\d)\s?kW([\s,.;:\)\(\\/)])/gi, '$1 kW$2');
txt.value = txt.value.replace(/(\d)\-kW([\s,.;:\)\(\\/)])/gi, '$1 kW$2');
 
// Standardise symbol for foot pounds
txt.value = txt.value.replace(/ft[ -.•\/]lb[fs]/gi, 'ft·lbf');
//the next two suspended until solution is found for wing loading (i.e. pounds per square foot)
txt.value = txt.value.replace(/lb[fs][ -.•\/]ft/gi, 'ft·lbf');
//txt.value = txt.value.replace(/lb[fs][ -.•\/]ft/gi, 'ft·lbf');
//txt.value = txt.value.replace(/lb[fs][ -.•\/]ft/gi, 'ft·lbf');
txt.value = txt.value.replace(/ft[ -.•\/]lb/gi, 'ft·lbf');