if(Number.prototype.toBoolean)
    console.error('Trying to overwrite Number.prototype.toBoolean');

Number.prototype.toBoolean ??=
function () {
    return this ? true : false;
}

Number.prototype.roundToDecimal ??= function(decimalPlaces){
    let factor = Math.pow(10,decimalPlaces);
    return Math.round(this * factor) / factor;
}