Bootstrap Progress Bar借助应用程序脚本变量
我在应用程序脚本中有这个Google Sheet Cell计数器,我不知道如何使用“百分比”变量设置Bootstrap Progress Bar。
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 ( "
I have this Google Sheet cell counter in Apps Script and I don't know how to set the bootstrap progress bar with 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 ( "???? Cada documento de Google Sheets tiene capacidad para diez millones de celdas. Has usado el <strong>" + percentage + "%</strong> del total con <strong>" + cells + " celdas</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>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用 nofollow noreferrer“> force portect scrinting scriptlets
&lt;?!= ... ?
强> html.html:
Use Force-printing scriptlets
<?!= ... ?>
Sample for a Webapp (please adapt it to your dialog as needed):
GS
html.html: