I created a Google Sheets cell counter in Apps Script and need help setting up the bootstrap progress bar using the "percentage" variable.
GS
function cellCounter() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheets = ss.getSheets();
var cells = 0;
sheets.forEach(function(sheet){
cells = cells + sheet.getMaxRows() * sheet.getMaxColumns();
});
var division = cells/10000000*100;
var percentage = +division.toFixed(0);
return ( "📈 Each Google Sheets document has a capacity for ten million cells. You have used <strong>" + percentage + "%</strong> of the total with <strong>" + cells + " cells</strong>." );
}
HTML
<div class="progress">
<div class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="75" aria-valuemin="0" aria-valuemax="100" style="width: 75%"></div>
</div>