java.js
// Rounds a number into a file size format. Has different priority modes, can also add zeroes (to prevent motion)
Rounds a number into a file size format. Has different priority modes, can also add zeroes (to prevent motion)
Rounds a number into a file size format . Has different priority modes can also add zeroes ( to prevent motion )
function roundSizeDisp(currentDisp, priorityMode, addZeroes) {
	function ifAddZeroes() {
		newerdisp = Math.round(newerdisp);
		newerdisp = newerdisp / 1000;
		if (addZeroes === 1) {newerdisp = addTheZeroes(newerdisp);}
	}
	if (currentDisp === 1) {newerdisp = '1 byte';}
	else {
		if (currentDisp >= 1000) {
			if (currentDisp >= 1000000) {
				if (currentDisp >= 1000000000) {
					if (currentDisp >= 1000000000000) {
						newerdisp = currentDisp / 1000000000;
						ifAddZeroes();
						newerdisp = `${newerdisp} TB`;
					} else {
						newerdisp = currentDisp / 1000000;
						ifAddZeroes();
						newerdisp = `${newerdisp} GB`;
					}
				} else {
					newerdisp = currentDisp / 1000;
					ifAddZeroes();
					newerdisp = `${newerdisp} MB`;
				}
			} else {
				newerdisp = Math.round(currentDisp);
				newerdisp = newerdisp / 1000;
				if (addZeroes === 1) {newerdisp = addTheZeroes(newerdisp);}
				newerdisp = `${newerdisp} KB`;
			}
		} else {
			newerdisp = Math.round(currentDisp);
			newerdisp = `${newerdisp} bytes`;
		}
	} if (priorityMode === 'n') {newdisp = newerdisp;}
	else if (priorityMode === 's') {
		bpscount.innerHTML = newerdisp + " per second";
		document.getElementById("ontopsps").innerHTML = newerdisp + " per second";
	} else if (priorityMode === 'm') {
		scorel.innerHTML = newerdisp;
		document.getElementById("ontopsize").innerHTML = newerdisp;
	} else if (priorityMode === "title") {document.querySelector("title").textContent = `${newerdisp} - idle file`;}
	else {return newerdisp;}
}
function roundSizeDisp ( currentDisp , priorityMode , addZeroes ) { function ifAddZeroes ( ) { newerdisp = Math . round ( newerdisp ) ; newerdisp = newerdisp / 1000 ; if ( addZeroes === 1 ) { newerdisp = addTheZeroes ( newerdisp ) ; } } if ( currentDisp === 1 ) { newerdisp = '1 byte' ; } else { if ( currentDisp >= 1000 ) { if ( currentDisp >= 1000000 ) { if ( currentDisp >= 1000000000 ) { if ( currentDisp >= 1000000000000 ) { newerdisp = currentDisp / 1000000000 ; ifAddZeroes ( ) ; newerdisp = ` ${ newerdisp } ` ; } else { newerdisp = currentDisp / 1000000 ; ifAddZeroes ( ) ; newerdisp = ` ${ newerdisp } ` ; } } else { newerdisp = currentDisp / 1000 ; ifAddZeroes ( ) ; newerdisp = ` ${ newerdisp } ` ; } } else { newerdisp = Math . round ( currentDisp ) ; newerdisp = newerdisp / 1000 ; if ( addZeroes === 1 ) { newerdisp = addTheZeroes ( newerdisp ) ; } newerdisp = ` ${ newerdisp } ` ; } } else { newerdisp = Math . round ( currentDisp ) ; newerdisp = ` ${ newerdisp } ` ; } } if ( priorityMode === 'n' ) { newdisp = newerdisp ; } else if ( priorityMode === 's' ) { bpscount . innerHTML = newerdisp + " per second" ; document . getElementById ( "ontopsps" ) . innerHTML = newerdisp + " per second" ; } else if ( priorityMode === 'm' ) { scorel . innerHTML = newerdisp ; document . getElementById ( "ontopsize" ) . innerHTML = newerdisp ; } else if ( priorityMode === "title" ) { document . querySelector ( "title" ) . textContent = ` ${ newerdisp } ` ; } else { return newerdisp ; } }
Rounds a number into a file size format.
Rounds a number into a file size format .
// TB // @ts-ignore // GB // @ts-ignore // MB // @ts-ignore // KB // @ts-ignore // Bytes // @ts-ignore // @ts-ignore // @ts-ignore