java.js
// Updates the bytes per second display
Updates the bytes per second display
Updates the bytes per second display
function refreshBPS() {
	if (doRoundDisplay === 1) {
		roundSizeDisp(sps, 's', 1);
		const shownsps = addCommasToNumber(sps);
		bpscount.title = `${shownsps} bytes per second`;
		const shownbpc = addCommasToNumber(spc);
		const roundedbpc = roundSizeDisp(spc, 'return', 1);
		bpcount.innerHTML = `${roundedbpc} per click`;
		bpcount.title = `${shownbpc} bytes per click`;
		document.getElementById("ontopspc").innerHTML = `${roundedbpc} per click`;
	} else {
		const shownsps = addCommasToNumber(sps);
		if (shownsps === 1) {
			bpscount.innerHTML = "1 byte per second";
			bpscount.title = "1 byte per second";
		} else {
			bpscount.innerHTML = `${shownsps} bytes per second`;
			bpscount.title = `${shownsps} bytes per second`;
		}
		const shownbpc = addCommasToNumber(spc);
		if (shownbpc === 1) {
			bpcount.innerHTML = "1 byte per click";
			bpcount.title = "1 byte per click";
			document.getElementById("ontopspc").innerHTML = `1 byte per click`;
		} else {
			bpcount.innerHTML = `${shownbpc} bytes per click`;
			bpcount.title = `${shownbpc} bytes per click`;
			document.getElementById("ontopspc").innerHTML = `${shownbpc} bytes per click`;
		}
	}
	checkBuildLevel();
}
function refreshBPS ( ) { if ( doRoundDisplay === 1 ) { roundSizeDisp ( sps , 's' , 1 ) ; const shownsps = addCommasToNumber ( sps ) ; bpscount . title = ` ${ shownsps } ` ; const shownbpc = addCommasToNumber ( spc ) ; const roundedbpc = roundSizeDisp ( spc , 'return' , 1 ) ; bpcount . innerHTML = ` ${ roundedbpc } ` ; bpcount . title = ` ${ shownbpc } ` ; document . getElementById ( "ontopspc" ) . innerHTML = ` ${ roundedbpc } ` ; } else { const shownsps = addCommasToNumber ( sps ) ; if ( shownsps === 1 ) { bpscount . innerHTML = "1 byte per second" ; bpscount . title = "1 byte per second" ; } else { bpscount . innerHTML = ` ${ shownsps } ` ; bpscount . title = ` ${ shownsps } ` ; } const shownbpc = addCommasToNumber ( spc ) ; if ( shownbpc === 1 ) { bpcount . innerHTML = "1 byte per click" ; bpcount . title = "1 byte per click" ; document . getElementById ( "ontopspc" ) . innerHTML = ` ` ; } else { bpcount . innerHTML = ` ${ shownbpc } ` ; bpcount . title = ` ${ shownbpc } ` ; document . getElementById ( "ontopspc" ) . innerHTML = ` ${ shownbpc } ` ; } } checkBuildLevel ( ) ; }
Updates the bytes per second display
Updates the bytes per second display
// If the bytes per second count is 1, show "byte" instead of "bytes" // If the bytes per click count is 1, show "byte" instead of "bytes"