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 69:
 
txt.value = txt.value.replace(/(\d)\s?ft\/second/gi, '$1 ft/s');
txt.value = txt.value.replace(/(\d)\s?ft\/sec(\W)/gi, '$1 ft/s$2');
txt.value = txt.value.replace(/(\d)\s?m\/second/gi, '$1 m/s');
txt.value = txt.value.replace(/(\d)\s?m\/sec(\W)/gi, '$1 m/s$2');
txt.value = txt.value.replace(/(\d)\s?km\/sec(\W)/gi, '$1 km/s$2');
txt.value = txt.value.replace(/frames?\/sec(\W)/gi, 'frame/s$1');
txt.value = txt.value.replace(/frames\/s(\W)/gi, 'frame/s$1');
 
Line 163 ⟶ 160:
// bytes per second
txt.value = txt.value.replace(/([KkMmGg])(Bps|bytes?\/s)/g, ' $1B/s');
txt.value = txt.value.replace(/bytes?\/secs(\W)/gi, 'B/s$1');
txt.value = txt.value.replace(/B\/sec(\W)/g, 'B/s$1');
 
// capitalization of prefix with bits and bytes